// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License"). You may
// not use this file except in compliance with the License. A copy of the
// License is located at
//
//     http://aws.amazon.com/apache2.0/
//
// or in the "license" file accompanying this file. This file 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.

// Code generated by ack-generate. DO NOT EDIT.

package v1alpha1

import (
	ackv1alpha1 "github.com/aws-controllers-k8s/runtime/apis/core/v1alpha1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// BucketSpec defines the desired state of Bucket.
//
// In terms of implementation, a Bucket is a resource.
type BucketSpec struct {

	// The canned ACL to apply to the bucket.
	//
	// This functionality is not supported for directory buckets.
	ACL *string `json:"acl,omitempty"`
	// Container for setting the transfer acceleration state.
	Accelerate *AccelerateConfiguration  `json:"accelerate,omitempty"`
	Analytics  []*AnalyticsConfiguration `json:"analytics,omitempty"`
	// Describes the cross-origin access configuration for objects in an Amazon
	// S3 bucket. For more information, see Enabling Cross-Origin Resource Sharing
	// (https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html) in the Amazon
	// S3 User Guide.
	CORS *CORSConfiguration `json:"cors,omitempty"`
	// The configuration information for the bucket.
	CreateBucketConfiguration *CreateBucketConfiguration         `json:"createBucketConfiguration,omitempty"`
	Encryption                *ServerSideEncryptionConfiguration `json:"encryption,omitempty"`
	// Allows grantee the read, write, read ACP, and write ACP permissions on the
	// bucket.
	//
	// This functionality is not supported for directory buckets.
	GrantFullControl *string `json:"grantFullControl,omitempty"`
	// Allows grantee to list the objects in the bucket.
	//
	// This functionality is not supported for directory buckets.
	GrantRead *string `json:"grantRead,omitempty"`
	// Allows grantee to read the bucket ACL.
	//
	// This functionality is not supported for directory buckets.
	GrantReadACP *string `json:"grantReadACP,omitempty"`
	// Allows grantee to create new objects in the bucket.
	//
	// For the bucket and object owners of existing objects, also allows deletions
	// and overwrites of those objects.
	//
	// This functionality is not supported for directory buckets.
	GrantWrite *string `json:"grantWrite,omitempty"`
	// Allows grantee to write the ACL for the applicable bucket.
	//
	// This functionality is not supported for directory buckets.
	GrantWriteACP      *string                            `json:"grantWriteACP,omitempty"`
	IntelligentTiering []*IntelligentTieringConfiguration `json:"intelligentTiering,omitempty"`
	Inventory          []*InventoryConfiguration          `json:"inventory,omitempty"`
	// Container for lifecycle rules. You can add as many as 1,000 rules.
	Lifecycle *BucketLifecycleConfiguration `json:"lifecycle,omitempty"`
	// Container for logging status information.
	Logging *BucketLoggingStatus    `json:"logging,omitempty"`
	Metrics []*MetricsConfiguration `json:"metrics,omitempty"`
	// The name of the bucket to create.
	//
	// General purpose buckets - For information about bucket naming restrictions,
	// see Bucket naming rules (https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html)
	// in the Amazon S3 User Guide.
	//
	// Directory buckets - When you use this operation with a directory bucket,
	// you must use path-style requests in the format https://s3express-control.region-code.amazonaws.com/bucket-name
	// . Virtual-hosted-style requests aren't supported. Directory bucket names
	// must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket
	// names must also follow the format bucket-base-name--zone-id--x-s3 (for example,
	// DOC-EXAMPLE-BUCKET--usw2-az1--x-s3). For information about bucket naming
	// restrictions, see Directory bucket naming rules (https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html)
	// in the Amazon S3 User Guide
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable once set"
	// +kubebuilder:validation:Required
	Name         *string                    `json:"name"`
	Notification *NotificationConfiguration `json:"notification,omitempty"`
	// Specifies whether you want S3 Object Lock to be enabled for the new bucket.
	//
	// This functionality is not supported for directory buckets.
	ObjectLockEnabledForBucket *bool   `json:"objectLockEnabledForBucket,omitempty"`
	ObjectOwnership            *string `json:"objectOwnership,omitempty"`
	// The OwnershipControls (BucketOwnerEnforced, BucketOwnerPreferred, or ObjectWriter)
	// that you want to apply to this Amazon S3 bucket.
	OwnershipControls *OwnershipControls `json:"ownershipControls,omitempty"`
	// The bucket policy as a JSON document.
	//
	// For directory buckets, the only IAM action supported in the bucket policy
	// is s3express:CreateSession.
	Policy *string `json:"policy,omitempty"`
	// The PublicAccessBlock configuration that you want to apply to this Amazon
	// S3 bucket. You can enable the configuration options in any combination. For
	// more information about when Amazon S3 considers a bucket or object public,
	// see The Meaning of "Public" (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status)
	// in the Amazon S3 User Guide.
	PublicAccessBlock *PublicAccessBlockConfiguration `json:"publicAccessBlock,omitempty"`
	Replication       *ReplicationConfiguration       `json:"replication,omitempty"`
	// Container for Payer.
	RequestPayment *RequestPaymentConfiguration `json:"requestPayment,omitempty"`
	// Container for the TagSet and Tag elements.
	Tagging *Tagging `json:"tagging,omitempty"`
	// Container for setting the versioning state.
	Versioning *VersioningConfiguration `json:"versioning,omitempty"`
	// Container for the request.
	Website *WebsiteConfiguration `json:"website,omitempty"`
}

// BucketStatus defines the observed state of Bucket
type BucketStatus struct {
	// All CRs managed by ACK have a common `Status.ACKResourceMetadata` member
	// that is used to contain resource sync state, account ownership,
	// constructed ARN for the resource
	// +kubebuilder:validation:Optional
	ACKResourceMetadata *ackv1alpha1.ResourceMetadata `json:"ackResourceMetadata"`
	// All CRs managed by ACK have a common `Status.Conditions` member that
	// contains a collection of `ackv1alpha1.Condition` objects that describe
	// the various terminal states of the CR and its backend AWS service API
	// resource
	// +kubebuilder:validation:Optional
	Conditions []*ackv1alpha1.Condition `json:"conditions"`
	// A forward slash followed by the name of the bucket.
	// +kubebuilder:validation:Optional
	Location *string `json:"location,omitempty"`
}

// Bucket is the Schema for the Buckets API
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
type Bucket struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              BucketSpec   `json:"spec,omitempty"`
	Status            BucketStatus `json:"status,omitempty"`
}

// BucketList contains a list of Bucket
// +kubebuilder:object:root=true
type BucketList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Bucket `json:"items"`
}

func init() {
	SchemeBuilder.Register(&Bucket{}, &BucketList{})
}
