---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  annotations:
    controller-gen.kubebuilder.io/version: v0.19.0
  name: buckets.dedicated.regionalserver.tidbcloud.com
spec:
  group: dedicated.regionalserver.tidbcloud.com
  names:
    categories:
    - regionserver
    kind: Bucket
    listKind: BucketList
    plural: buckets
    singular: bucket
  scope: Namespaced
  versions:
  - additionalPrinterColumns:
    - jsonPath: .metadata.creationTimestamp
      name: AGE
      type: date
    - jsonPath: .status.bucket.name
      name: BUCKET
      type: string
    - jsonPath: .spec.id
      name: BUCKET_ID
      type: string
    - jsonPath: .status.phase
      name: Phase
      type: string
    name: v1alpha1
    schema:
      openAPIV3Schema:
        description: Bucket is the Schema for the buckets API
        properties:
          apiVersion:
            description: |-
              APIVersion defines the versioned schema of this representation of an object.
              Servers should convert recognized schemas to the latest internal value, and
              may reject unrecognized values.
              More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
            type: string
          kind:
            description: |-
              Kind is a string value representing the REST resource this object represents.
              Servers may infer this from the endpoint the client submits requests to.
              Cannot be updated.
              In CamelCase.
              More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
            type: string
          metadata:
            type: object
          spec:
            properties:
              accountRef:
                description: |-
                  AccountReference is a reference to an Account CR.
                  It can be extended to use other types of references, like label selector.
                properties:
                  accountId:
                    description: aws account id, gcp project id or azure subscription
                      id
                    type: string
                  providerConfigName:
                    type: string
                  resourceGroupName:
                    description: ResourceGroupName is used for azure to place all
                      dataplane resources in an existing RG.
                    type: string
                  role:
                    type: string
                required:
                - accountId
                - providerConfigName
                type: object
              dataplaneId:
                type: string
              grantedDataplaneIds:
                items:
                  type: string
                type: array
              id:
                type: string
              lifecycleRules:
                items:
                  properties:
                    enabled:
                      type: boolean
                    expirationDays:
                      format: int32
                      type: integer
                    id:
                      type: string
                    incompleteUploadExpirationDays:
                      format: int32
                      type: integer
                    prefixFilter:
                      type: string
                    tagsFilter:
                      items:
                        properties:
                          key:
                            type: string
                          value:
                            type: string
                        type: object
                      type: array
                  type: object
                type: array
              manualBackupLifecycleRules:
                description: |-
                  ManualBackupLifecycleRules holds lifecycle rules for manual backup deletion.
                  These rules are managed independently from LifecycleRules via incremental add/remove APIs,
                  and are merged with LifecycleRules when syncing to the cloud provider.
                items:
                  properties:
                    enabled:
                      type: boolean
                    expirationDays:
                      format: int32
                      type: integer
                    id:
                      type: string
                    incompleteUploadExpirationDays:
                      format: int32
                      type: integer
                    prefixFilter:
                      type: string
                    tagsFilter:
                      items:
                        properties:
                          key:
                            type: string
                          value:
                            type: string
                        type: object
                      type: array
                  type: object
                type: array
              nodeRoleARN:
                type: string
              ownership:
                description: |-
                  ResourceOwnership identifies the SharedPool that owns a DPM resource.
                  The parent DataPlane association remains on the owning resource.
                properties:
                  sharedPoolID:
                    minLength: 1
                    type: string
                required:
                - sharedPoolID
                type: object
              region:
                type: string
              tags:
                additionalProperties:
                  type: string
                type: object
            type: object
            x-kubernetes-validations:
            - message: ownership is immutable
              rule: has(self.ownership) == has(oldSelf.ownership) && (!has(self.ownership)
                || self.ownership == oldSelf.ownership)
          status:
            properties:
              bucket:
                properties:
                  name:
                    type: string
                  namespace:
                    type: string
                required:
                - name
                - namespace
                type: object
              bucketPolicy:
                properties:
                  name:
                    type: string
                  namespace:
                    type: string
                required:
                - name
                - namespace
                type: object
              phase:
                type: string
            type: object
        type: object
    served: true
    storage: true
    subresources:
      status: {}
