package common

type RegionInfo struct {
	Name        string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	DisplayName string `protobuf:"bytes,2,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"`
}

type BackupCycle string

const (
	BackupCycle_DAILY  BackupCycle = "DAILY"
	BackupCycle_WEEKLY BackupCycle = "WEEKLY"
)

type WeekDay string

const (
	WeekDay_SUNDAY    WeekDay = "SUNDAY"
	WeekDay_MONDAY    WeekDay = "MONDAY"
	WeekDay_TUESDAY   WeekDay = "TUESDAY"
	WeekDay_WEDNESDAY WeekDay = "WEDNESDAY"
	WeekDay_THURSDAY  WeekDay = "THURSDAY"
	WeekDay_FRIDAY    WeekDay = "FRIDAY"
	WeekDay_SATURDAY  WeekDay = "SATURDAY"
)

type BackupSettingStatus string

const (
	BackupSettingStatus_Creating                 BackupSettingStatus = "Creating"
	BackupSettingStatus_Editing_Region           BackupSettingStatus = "Editing_Region"
	BackupSettingStatus_Editing_PiTR             BackupSettingStatus = "Editing_PiTR"
	BackupSettingStatus_Normal                   BackupSettingStatus = "Normal"
	BackupSettingStatus_Deleted                  BackupSettingStatus = "Deleted"
	BackupSettingStatus_Waiting_For_Editing_PiTR BackupSettingStatus = "Waiting_For_Editing_PiTR"
)

type ExecuteRestoreReq struct {
	ClusterName  string                    `protobuf:"bytes,3,opt,name=cluster_name,json=clusterName,proto3" json:"cluster_name,omitempty"`
	Description  string                    `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"`
	Password     string                    `protobuf:"bytes,5,opt,name=password,proto3" json:"password,omitempty"`
	Components   []*SimpleClusterComponent `protobuf:"bytes,8,rep,name=components,proto3" json:"components,omitempty"`
	Port         int32                     `protobuf:"varint,9,opt,name=port,proto3" json:"port,omitempty"`
	RestoreMode  RestoreMode               `protobuf:"varint,10,opt,name=restore_mode,json=restoreMode,proto3,enum=dataflow.RestoreMode" json:"restore_mode,omitempty"`
	RestoredTs   int64                     `protobuf:"varint,11,opt,name=restored_ts,json=restoredTs,proto3" json:"restored_ts,omitempty"`
	Region       string                    `protobuf:"bytes,12,opt,name=region,proto3" json:"region,omitempty"`
	BackupRegion string                    `protobuf:"bytes,13,opt,name=backup_region,json=backupRegion,proto3" json:"backup_region,omitempty"`
}

type SimpleClusterComponent struct {
	ComponentType   ComponentType `protobuf:"varint,1,opt,name=component_type,json=componentType,proto3,enum=dataflow.ComponentType" json:"component_type,omitempty"`
	NodeProfileName string        `protobuf:"bytes,5,opt,name=node_profile_name,json=nodeProfileName,proto3" json:"node_profile_name,omitempty"`
	Replicas        int32         `protobuf:"varint,3,opt,name=replicas,proto3" json:"replicas,omitempty"`
	StorageSizeGi   int32         `protobuf:"varint,4,opt,name=storage_size_gi,json=storageSizeGi,proto3" json:"storage_size_gi,omitempty"`
}

type ComponentType string

const (
	ComponentType_COMPONENT_TYPE_UNSPECIFIED ComponentType = "COMPONENT_TYPE_UNSPECIFIED"
	ComponentType_COMPONENT_TYPE_TIDB        ComponentType = "COMPONENT_TYPE_TIDB"
	ComponentType_COMPONENT_TYPE_TIKV        ComponentType = "COMPONENT_TYPE_TIKV"
	ComponentType_COMPONENT_TYPE_TIFLASH     ComponentType = "COMPONENT_TYPE_TIFLASH"
	ComponentType_COMPONENT_TYPE_PD          ComponentType = "COMPONENT_TYPE_PD"
	ComponentType_COMPONENT_TYPE_TICDC       ComponentType = "COMPONENT_TYPE_TICDC"
)

type RestoreMode string

const (
	RestoreMode_RESTORE_MODE_UNSPECIFIED     RestoreMode = "RESTORE_MODE_UNSPECIFIED"
	RestoreMode_RESTORE_MODE_SNAPSHOT        RestoreMode = "RESTORE_MODE_SNAPSHOT"
	RestoreMode_RESTORE_MODE_PITR            RestoreMode = "RESTORE_MODE_PITR"
	RestoreMode_RESTORE_MODE_VOLUME_SNAPSHOT RestoreMode = "RESTORE_MODE_VOLUME_SNAPSHOT"
)

type ExecuteRestoreResp struct {
	Id        string `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	ClusterId string `protobuf:"varint,2,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"`
	OrgId     string `protobuf:"varint,3,opt,name=org_id,json=orgId,proto3" json:"org_id,omitempty"`
}

type QueryBackupSettingRespV2 struct {
	Status                   BackupSettingStatus       `protobuf:"varint,1,opt,name=status,proto3,enum=dataflow.BackupSettingStatus" json:"status,omitempty"`
	Actions                  []BackupSettingActionType `protobuf:"varint,2,rep,packed,name=actions,proto3,enum=dataflow.BackupSettingActionType" json:"actions,omitempty"`
	SnapshotBackupSchedule   *SnapshotBackupSchedule   `protobuf:"bytes,3,opt,name=snapshot_backup_schedule,json=snapshotBackupSchedule,proto3,oneof" json:"snapshot_backup_schedule,omitempty"`
	ContinuousBackupSchedule *ContinuousBackupSchedule `protobuf:"bytes,4,opt,name=continuous_backup_schedule,json=continuousBackupSchedule,proto3,oneof" json:"continuous_backup_schedule,omitempty"`
	Regions                  []*RegionInfo             `protobuf:"bytes,5,rep,name=regions,proto3" json:"regions,omitempty"`
}

type BackupSettingActionType string

const (
	BackupSettingActionType_Edit_Region   BackupSettingActionType = "Edit_Region"
	BackupSettingActionType_Edit_PiTR     BackupSettingActionType = "Edit_PiTR"
	BackupSettingActionType_Edit_Schedule BackupSettingActionType = "Edit_Schedule"
)

type SnapshotBackupSchedule struct {
	Disable           bool                       `protobuf:"varint,1,opt,name=disable,proto3" json:"disable,omitempty"`
	ScheduleType      SnapshotBackupScheduleType `protobuf:"varint,2,opt,name=schedule_type,json=scheduleType,proto3,enum=dataflow.SnapshotBackupScheduleType" json:"schedule_type,omitempty"`
	DailyScheduleTime string                     `protobuf:"bytes,3,opt,name=daily_schedule_time,json=dailyScheduleTime,proto3" json:"daily_schedule_time,omitempty"`
	WeeklySchedule    *WeeklySchedule            `protobuf:"bytes,4,opt,name=weekly_schedule,json=weeklySchedule,proto3" json:"weekly_schedule,omitempty"`
	RetentionPolicy   *RetentionPolicy           `protobuf:"bytes,5,opt,name=retention_policy,json=retentionPolicy,proto3" json:"retention_policy,omitempty"`
	NextBackupTime    string                     `protobuf:"bytes,6,opt,name=next_backup_time,json=nextBackupTime,proto3" json:"next_backup_time,omitempty"`
}

type SnapshotBackupScheduleType string

const (
	SnapshotBackupScheduleType_Daily  SnapshotBackupScheduleType = "Daily"
	SnapshotBackupScheduleType_Weekly SnapshotBackupScheduleType = "Weekly"
)

type WeeklySchedule struct {
	Days         []WeekDay `protobuf:"varint,5,rep,packed,name=days,proto3,enum=dataflow.WeekDay" json:"days,omitempty"`
	ScheduleTime string    `protobuf:"bytes,3,opt,name=schedule_time,json=scheduleTime,proto3" json:"schedule_time,omitempty"`
}

type RetentionPolicy struct {
	RetentionPeriod string `protobuf:"varint,1,opt,name=retention_period,json=retentionPeriod,proto3" json:"retention_period,omitempty"`
}

type ContinuousBackupSchedule struct {
	Enable bool `protobuf:"varint,1,opt,name=enable,proto3" json:"enable,omitempty"`
}

type ModifyBackupSettingReqV2 struct {
	DryRun                   bool                      `protobuf:"varint,4,opt,name=dry_run,json=dryRun,proto3" json:"dry_run,omitempty"`
	SnapshotBackupSchedule   *SnapshotBackupSchedule   `protobuf:"bytes,5,opt,name=snapshot_backup_schedule,json=snapshotBackupSchedule,proto3,oneof" json:"snapshot_backup_schedule,omitempty"`
	ContinuousBackupSchedule *ContinuousBackupSchedule `protobuf:"bytes,6,opt,name=continuous_backup_schedule,json=continuousBackupSchedule,proto3,oneof" json:"continuous_backup_schedule,omitempty"`
	Regions                  []*RegionInfo             `protobuf:"bytes,7,rep,name=regions,proto3" json:"regions,omitempty"`
}

type CreateBackupReq struct {
	Name       string     `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
	BackupType BackupType `protobuf:"varint,5,opt,name=backup_type,json=backupType,proto3,enum=dataflow.BackupType" json:"backup_type,omitempty"`
}

type BackupType string

const (
	BackupType_AUTO   BackupType = "AUTO"
	BackupType_MANUAL BackupType = "MANUAL"
)

type CreateRecoveryGroupRequest struct {
	Setting *RecoveryGroupSetting `protobuf:"bytes,1,opt,name=setting,proto3" json:"setting,omitempty"`
	Labels  map[string]string     `protobuf:"bytes,2,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
}

type RecoveryGroupSetting struct {
	DisplayName      string               `protobuf:"bytes,1,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"`
	TableFilters     []string             `protobuf:"bytes,2,rep,name=table_filters,json=tableFilters,proto3" json:"table_filters,omitempty"`
	ResiliencyPolicy ResiliencyPolicyType `protobuf:"varint,3,opt,name=resiliency_policy,json=resiliencyPolicy,proto3,enum=dedicated.v1beta1.ResiliencyPolicyType" json:"resiliency_policy,omitempty"`
	Primary          string               `protobuf:"varint,4,opt,name=primary,proto3" json:"primary,omitempty"`
	Secondaries      []string             `protobuf:"varint,5,rep,packed,name=secondaries,proto3" json:"secondaries,omitempty"`
}

type ResiliencyPolicyType string

const (
	ResiliencyPolicyType_WITHOUT_CONSISTENCY_GUARANTEE ResiliencyPolicyType = "WITHOUT_CONSISTENCY_GUARANTEE"
)

type CreateRecoveryGroupResp struct {
	Id string `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
}

type GetRecoveryGroupResp struct {
	Name              string                    `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Id                string                    `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"`
	CreateTime        string                    `protobuf:"bytes,3,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
	UpdateTime        string                    `protobuf:"bytes,4,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"`
	DeleteTime        string                    `protobuf:"bytes,5,opt,name=delete_time,json=deleteTime,proto3" json:"delete_time,omitempty"`
	Setting           *RecoveryGroupSetting     `protobuf:"bytes,6,opt,name=setting,proto3" json:"setting,omitempty"`
	State             RecoveryGroupState        `protobuf:"varint,7,opt,name=state,proto3,enum=dedicated.v1beta1.RecoveryGroupState" json:"state,omitempty"`
	InProgressActions []RecoveryGroupActionType `protobuf:"varint,8,rep,packed,name=in_progress_actions,json=inProgressActions,proto3,enum=dedicated.v1beta1.RecoveryGroupActionType" json:"in_progress_actions,omitempty"`
	AllowedActions    []RecoveryGroupActionType `protobuf:"varint,9,rep,packed,name=allowed_actions,json=allowedActions,proto3,enum=dedicated.v1beta1.RecoveryGroupActionType" json:"allowed_actions,omitempty"`
	Topology          *RecoveryGroupTopology    `protobuf:"bytes,10,opt,name=topology,proto3" json:"topology,omitempty"`
	Labels            map[string]string         `protobuf:"bytes,11,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
	Creator           string                    `protobuf:"bytes,12,opt,name=creator,proto3" json:"creator,omitempty"`
}

type RecoveryGroupState string

const (
	RecoveryGroupState_RECOVERY_GROUP_STATE_UNSPECIFIED RecoveryGroupState = "RECOVERY_GROUP_STATE_UNSPECIFIED"
	RecoveryGroupState_CREATING                         RecoveryGroupState = "CREATING"
	RecoveryGroupState_MODIFYING                        RecoveryGroupState = "MODIFYING"
	RecoveryGroupState_DELETING                         RecoveryGroupState = "DELETING"
	RecoveryGroupState_DELETED                          RecoveryGroupState = "DELETED"
	RecoveryGroupState_WARNING                          RecoveryGroupState = "WARNING"
	RecoveryGroupState_FAILING_OVER                     RecoveryGroupState = "FAILING_OVER"
	RecoveryGroupState_MIGRATING                        RecoveryGroupState = "MIGRATING"
	RecoveryGroupState_REPROTECTING                     RecoveryGroupState = "REPROTECTING"
	RecoveryGroupState_AVAILABLE                        RecoveryGroupState = "AVAILABLE"
	RecoveryGroupState_FAILED                           RecoveryGroupState = "FAILED"
	RecoveryGroupState_UNPROTECTED                      RecoveryGroupState = "UNPROTECTED"
)

type RecoveryGroupActionType string

const (
	RecoveryGroupActionType_RECOVERY_GROUP_ACTION_TYPE_UNSPECIFIED RecoveryGroupActionType = "RECOVERY_GROUP_ACTION_TYPE_UNSPECIFIED"
	RecoveryGroupActionType_CREATE                                 RecoveryGroupActionType = "CREATE"
	RecoveryGroupActionType_MODIFY                                 RecoveryGroupActionType = "MODIFY"
	RecoveryGroupActionType_DELETE                                 RecoveryGroupActionType = "DELETE"
	RecoveryGroupActionType_FAILOVER                               RecoveryGroupActionType = "FAILOVER"
	RecoveryGroupActionType_REPROTECT                              RecoveryGroupActionType = "REPROTECT"
	RecoveryGroupActionType_MIGRATE                                RecoveryGroupActionType = "MIGRATE"
)

type RecoveryGroupTopology struct {
	Clusters     []*RgClusterInfo     `protobuf:"bytes,1,rep,name=clusters,proto3" json:"clusters,omitempty"`
	Replications []*RgReplicationInfo `protobuf:"bytes,2,rep,name=replications,proto3" json:"replications,omitempty"`
}

type RgClusterInfo struct {
	Id          string                  `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	DisplayName string                  `protobuf:"bytes,2,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"`
	State       RgClusterComponentState `protobuf:"varint,3,opt,name=state,proto3,enum=dedicated.v1beta1.RgClusterComponentState" json:"state,omitempty"`
	Role        RgClusterRole           `protobuf:"varint,4,opt,name=role,proto3,enum=dedicated.v1beta1.RgClusterRole" json:"role,omitempty"`
	Region      *Region                 `protobuf:"bytes,5,opt,name=region,proto3" json:"region,omitempty"`
}

type RgClusterComponentState string

const (
	RgClusterComponentState_RG_CLUSTER_COMPONENT_STATE_UNSPECIFIED RgClusterComponentState = "RG_CLUSTER_COMPONENT_STATE_UNSPECIFIED"
	RgClusterComponentState_HEALTHY                                RgClusterComponentState = "HEALTHY"
	RgClusterComponentState_BROKEN                                 RgClusterComponentState = "BROKEN"
	RgClusterComponentState_ACTIONING                              RgClusterComponentState = "ACTIONING"
)

type RgClusterRole string

const (
	RgClusterRole_RG_CLUSTER_ROLE_UNSPECIFIED RgClusterRole = "RG_CLUSTER_ROLE_UNSPECIFIED"
	RgClusterRole_PRIMARY                     RgClusterRole = "PRIMARY"
	RgClusterRole_SECONDARY                   RgClusterRole = "SECONDARY"
)

type Region struct {
	Name        string    `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	DisplayName string    `protobuf:"bytes,2,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"`
	Id          string    `protobuf:"bytes,3,opt,name=id,proto3" json:"id,omitempty"`
	Provider    *Provider `protobuf:"bytes,4,opt,name=provider,proto3" json:"provider,omitempty"`
}

type Provider struct {
	Name        string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
}

type RgReplicationInfo struct {
	Source        string                `protobuf:"varint,1,opt,name=source,proto3" json:"source,omitempty"`
	Dest          string                `protobuf:"varint,2,opt,name=dest,proto3" json:"dest,omitempty"`
	State         RgReplicationState    `protobuf:"varint,3,opt,name=state,proto3,enum=dedicated.v1beta1.RgReplicationState" json:"state,omitempty"`
	MetricsLabels []*RgLinkMetricsLabel `protobuf:"bytes,4,rep,name=metrics_labels,json=metricsLabels,proto3" json:"metrics_labels,omitempty"`
}

type RgReplicationState string

const (
	RgReplicationState_RG_REPLICATION_STATE_UNSPECIFIED RgReplicationState = "RG_REPLICATION_STATE_UNSPECIFIED"
	RgReplicationState_REPLICATION_HEALTHY              RgReplicationState = "REPLICATION_HEALTHY"
	RgReplicationState_REPLICATION_BROKEN               RgReplicationState = "REPLICATION_BROKEN"
	RgReplicationState_REPLICATION_ACTIONING            RgReplicationState = "REPLICATION_ACTIONING"
)

type RgLinkMetricsLabel struct {
	Namespace  string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`
	Instance   string `protobuf:"bytes,2,opt,name=instance,proto3" json:"instance,omitempty"`
	Changefeed string `protobuf:"bytes,3,opt,name=changefeed,proto3" json:"changefeed,omitempty"`
}

type FailoverRecoveryGroupRequest struct {
	NewPrimaryId string            `protobuf:"varint,2,opt,name=new_primary_id,json=newPrimaryId,proto3" json:"new_primary_id,omitempty"`
	Labels       map[string]string `protobuf:"bytes,11,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
}

type ReprotectRecoveryGroupRequest struct {
	ReprotectedIds []string          `protobuf:"varint,2,rep,packed,name=reprotected_ids,json=reprotectedIds,proto3" json:"reprotected_ids,omitempty"`
	Labels         map[string]string `protobuf:"bytes,11,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
}
