# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  annotations:
    cnrm.cloud.google.com/version: 1.128.0
  creationTimestamp: null
  labels:
    cnrm.cloud.google.com/managed-by-kcc: "true"
    cnrm.cloud.google.com/stability-level: stable
    cnrm.cloud.google.com/system: "true"
    cnrm.cloud.google.com/tf2crd: "true"
  name: storagebuckets.storage.cnrm.cloud.google.com
spec:
  group: storage.cnrm.cloud.google.com
  names:
    categories:
    - gcp
    kind: StorageBucket
    plural: storagebuckets
    shortNames:
    - gcpstoragebucket
    - gcpstoragebuckets
    singular: storagebucket
  scope: Namespaced
  versions:
  - additionalPrinterColumns:
    - jsonPath: .metadata.creationTimestamp
      name: Age
      type: date
    - description: When 'True', the most recent reconcile of the resource succeeded
      jsonPath: .status.conditions[?(@.type=='Ready')].status
      name: Ready
      type: string
    - description: The reason for the value in 'Ready'
      jsonPath: .status.conditions[?(@.type=='Ready')].reason
      name: Status
      type: string
    - description: The last transition time for the value in 'Status'
      jsonPath: .status.conditions[?(@.type=='Ready')].lastTransitionTime
      name: Status Age
      type: date
    name: v1beta1
    schema:
      openAPIV3Schema:
        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/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/api-conventions.md#types-kinds'
            type: string
          metadata:
            type: object
          spec:
            properties:
              autoclass:
                description: The bucket's autoclass configuration.
                properties:
                  enabled:
                    description: While set to true, autoclass automatically transitions
                      objects in your bucket to appropriate storage classes based
                      on each object's access pattern.
                    type: boolean
                required:
                - enabled
                type: object
              bucketPolicyOnly:
                description: |-
                  DEPRECATED. Please use the `uniformBucketLevelAccess` field as this field has been renamed by Google. The `uniformBucketLevelAccess` field will supersede this field.
                  Enables Bucket PolicyOnly access to a bucket.
                type: boolean
              cors:
                description: The bucket's Cross-Origin Resource Sharing (CORS) configuration.
                items:
                  properties:
                    maxAgeSeconds:
                      description: The value, in seconds, to return in the Access-Control-Max-Age
                        header used in preflight responses.
                      type: integer
                    method:
                      description: 'The list of HTTP methods on which to include CORS
                        response headers, (GET, OPTIONS, POST, etc) Note: "*" is permitted
                        in the list of methods, and means "any method".'
                      items:
                        type: string
                      type: array
                    origin:
                      description: 'The list of Origins eligible to receive CORS response
                        headers. Note: "*" is permitted in the list of origins, and
                        means "any Origin".'
                      items:
                        type: string
                      type: array
                    responseHeader:
                      description: The list of HTTP headers other than the simple
                        response headers to give permission for the user-agent to
                        share across domains.
                      items:
                        type: string
                      type: array
                  type: object
                type: array
              customPlacementConfig:
                description: The bucket's custom location configuration, which specifies
                  the individual regions that comprise a dual-region bucket. If the
                  bucket is designated a single or multi-region, the parameters are
                  empty.
                properties:
                  dataLocations:
                    description: 'Immutable. The list of individual regions that comprise
                      a dual-region bucket. See the docs for a list of acceptable
                      regions. Note: If any of the data_locations changes, it will
                      recreate the bucket.'
                    items:
                      type: string
                    type: array
                required:
                - dataLocations
                type: object
              defaultEventBasedHold:
                description: Whether or not to automatically apply an eventBasedHold
                  to new objects added to the bucket.
                type: boolean
              encryption:
                description: The bucket's encryption configuration.
                properties:
                  kmsKeyRef:
                    oneOf:
                    - not:
                        required:
                        - external
                      required:
                      - name
                    - not:
                        anyOf:
                        - required:
                          - name
                        - required:
                          - namespace
                      required:
                      - external
                    properties:
                      external:
                        description: 'Allowed value: The `selfLink` field of a `KMSCryptoKey`
                          resource.'
                        type: string
                      name:
                        description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
                        type: string
                      namespace:
                        description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
                        type: string
                    type: object
                required:
                - kmsKeyRef
                type: object
              lifecycleRule:
                description: The bucket's Lifecycle Rules configuration.
                items:
                  properties:
                    action:
                      description: The Lifecycle Rule's action configuration. A single
                        block of this type is supported.
                      properties:
                        storageClass:
                          description: 'The target Storage Class of objects affected
                            by this Lifecycle Rule. Supported values include: MULTI_REGIONAL,
                            REGIONAL, NEARLINE, COLDLINE, ARCHIVE.'
                          type: string
                        type:
                          description: 'The type of the action of this Lifecycle Rule.
                            Supported values include: Delete, SetStorageClass and
                            AbortIncompleteMultipartUpload.'
                          type: string
                      required:
                      - type
                      type: object
                    condition:
                      description: The Lifecycle Rule's condition configuration.
                      properties:
                        age:
                          description: Minimum age of an object in days to satisfy
                            this condition.
                          type: integer
                        createdBefore:
                          description: Creation date of an object in RFC 3339 (e.g.
                            2017-06-13) to satisfy this condition.
                          type: string
                        customTimeBefore:
                          description: Creation date of an object in RFC 3339 (e.g.
                            2017-06-13) to satisfy this condition.
                          type: string
                        daysSinceCustomTime:
                          description: Number of days elapsed since the user-specified
                            timestamp set on an object.
                          type: integer
                        daysSinceNoncurrentTime:
                          description: "Number of days elapsed since the noncurrent
                            timestamp of an object. This\n\t\t\t\t\t\t\t\t\t\tcondition
                            is relevant only for versioned objects."
                          type: integer
                        matchesPrefix:
                          description: One or more matching name prefixes to satisfy
                            this condition.
                          items:
                            type: string
                          type: array
                        matchesStorageClass:
                          description: 'Storage Class of objects to satisfy this condition.
                            Supported values include: MULTI_REGIONAL, REGIONAL, NEARLINE,
                            COLDLINE, ARCHIVE, STANDARD, DURABLE_REDUCED_AVAILABILITY.'
                          items:
                            type: string
                          type: array
                        matchesSuffix:
                          description: One or more matching name suffixes to satisfy
                            this condition.
                          items:
                            type: string
                          type: array
                        noncurrentTimeBefore:
                          description: Creation date of an object in RFC 3339 (e.g.
                            2017-06-13) to satisfy this condition.
                          type: string
                        numNewerVersions:
                          description: Relevant only for versioned objects. The number
                            of newer versions of an object to satisfy this condition.
                          type: integer
                        withState:
                          description: 'Match to live and/or archived objects. Unversioned
                            buckets have only live objects. Supported values include:
                            "LIVE", "ARCHIVED", "ANY".'
                          type: string
                      type: object
                  required:
                  - action
                  - condition
                  type: object
                type: array
              location:
                default: US
                description: Immutable. The Google Cloud Storage location.
                type: string
              logging:
                description: The bucket's Access & Storage Logs configuration.
                properties:
                  logBucket:
                    description: The bucket that will receive log objects.
                    type: string
                  logObjectPrefix:
                    description: The object prefix for log objects. If it's not provided,
                      by default Google Cloud Storage sets this to this bucket's name.
                    type: string
                required:
                - logBucket
                type: object
              publicAccessPrevention:
                description: Prevents public access to a bucket.
                type: string
              requesterPays:
                description: Enables Requester Pays on a storage bucket.
                type: boolean
              resourceID:
                description: Immutable. Optional. The name of the resource. Used for
                  creation and acquisition. When unset, the value of `metadata.name`
                  is used as the default.
                type: string
              retentionPolicy:
                description: Configuration of the bucket's data retention policy for
                  how long objects in the bucket should be retained.
                properties:
                  isLocked:
                    description: 'If set to true, the bucket will be locked and permanently
                      restrict edits to the bucket''s retention policy.  Caution:
                      Locking a bucket is an irreversible action.'
                    type: boolean
                  retentionPeriod:
                    description: The period of time, in seconds, that objects in the
                      bucket must be retained and cannot be deleted, overwritten,
                      or archived. The value must be less than 3,155,760,000 seconds.
                    type: integer
                required:
                - retentionPeriod
                type: object
              softDeletePolicy:
                description: The bucket's soft delete policy, which defines the period
                  of time that soft-deleted objects will be retained, and cannot be
                  permanently deleted. If it is not provided, by default Google Cloud
                  Storage sets this to default soft delete policy.
                properties:
                  retentionDurationSeconds:
                    description: The duration in seconds that soft-deleted objects
                      in the bucket will be retained and cannot be permanently deleted.
                      Default value is 604800.
                    type: integer
                type: object
              storageClass:
                description: 'The Storage Class of the new bucket. Supported values
                  include: STANDARD, MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE,
                  ARCHIVE.'
                type: string
              uniformBucketLevelAccess:
                description: Enables uniform bucket-level access on a bucket.
                type: boolean
              versioning:
                description: The bucket's Versioning configuration.
                properties:
                  enabled:
                    description: While set to true, versioning is fully enabled for
                      this bucket.
                    type: boolean
                required:
                - enabled
                type: object
              website:
                description: Configuration if the bucket acts as a website.
                properties:
                  mainPageSuffix:
                    description: Behaves as the bucket's directory index where missing
                      objects are treated as potential directories.
                    type: string
                  notFoundPage:
                    description: The custom object to return when a requested resource
                      is not found.
                    type: string
                type: object
            type: object
          status:
            properties:
              conditions:
                description: Conditions represent the latest available observation
                  of the resource's current state.
                items:
                  properties:
                    lastTransitionTime:
                      description: Last time the condition transitioned from one status
                        to another.
                      type: string
                    message:
                      description: Human-readable message indicating details about
                        last transition.
                      type: string
                    reason:
                      description: Unique, one-word, CamelCase reason for the condition's
                        last transition.
                      type: string
                    status:
                      description: Status is the status of the condition. Can be True,
                        False, Unknown.
                      type: string
                    type:
                      description: Type is the type of the condition.
                      type: string
                  type: object
                type: array
              observedGeneration:
                description: ObservedGeneration is the generation of the resource
                  that was most recently observed by the Config Connector controller.
                  If this is equal to metadata.generation, then that means that the
                  current reported status reflects the most recent desired state of
                  the resource.
                type: integer
              observedState:
                description: The observed state of the underlying GCP resource.
                properties:
                  softDeletePolicy:
                    description: The bucket's soft delete policy, which defines the
                      period of time that soft-deleted objects will be retained, and
                      cannot be permanently deleted. If it is not provided, by default
                      Google Cloud Storage sets this to default soft delete policy.
                    properties:
                      effectiveTime:
                        description: Server-determined value that indicates the time
                          from which the policy, or one with a greater retention,
                          was effective. This value is in RFC 3339 format.
                        type: string
                      retentionDurationSeconds:
                        description: The duration in seconds that soft-deleted objects
                          in the bucket will be retained and cannot be permanently
                          deleted. Default value is 604800.
                        type: integer
                    type: object
                type: object
              selfLink:
                description: The URI of the created resource.
                type: string
              url:
                description: The base URL of the bucket, in the format gs://<bucket-name>.
                type: string
            type: object
        type: object
    served: true
    storage: true
    subresources:
      status: {}
status:
  acceptedNames:
    kind: ""
    plural: ""
  conditions: []
  storedVersions: []
