// 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"
)

// GlobalClusterSpec defines the desired state of GlobalCluster.
//
// A data type representing an Aurora global database.
type GlobalClusterSpec struct {

	// The name for your database of up to 64 alphanumeric characters. If you don't
	// specify a name, Amazon Aurora doesn't create a database in the global database
	// cluster.
	//
	// Constraints:
	//
	//   - Can't be specified if SourceDBClusterIdentifier is specified. In this
	//     case, Amazon Aurora uses the database name from the source DB cluster.
	DatabaseName *string `json:"databaseName,omitempty"`
	// Specifies whether to enable deletion protection for the new global database
	// cluster. The global database can't be deleted when deletion protection is
	// enabled.
	DeletionProtection *bool `json:"deletionProtection,omitempty"`
	// The database engine to use for this global database cluster.
	//
	// Valid Values: aurora-mysql | aurora-postgresql
	//
	// Constraints:
	//
	//   - Can't be specified if SourceDBClusterIdentifier is specified. In this
	//     case, Amazon Aurora uses the engine of the source DB cluster.
	Engine *string `json:"engine,omitempty"`
	// The engine version to use for this global database cluster.
	//
	// Constraints:
	//
	//   - Can't be specified if SourceDBClusterIdentifier is specified. In this
	//     case, Amazon Aurora uses the engine version of the source DB cluster.
	EngineVersion *string `json:"engineVersion,omitempty"`
	// The cluster identifier for this global database cluster. This parameter is
	// stored as a lowercase string.
	GlobalClusterIdentifier *string `json:"globalClusterIdentifier,omitempty"`
	// The Amazon Resource Name (ARN) to use as the primary cluster of the global
	// database.
	//
	// If you provide a value for this parameter, don't specify values for the following
	// settings because Amazon Aurora uses the values from the specified source
	// DB cluster:
	//
	//   - DatabaseName
	//
	//   - Engine
	//
	//   - EngineVersion
	//
	//   - StorageEncrypted
	SourceDBClusterIdentifier *string `json:"sourceDBClusterIdentifier,omitempty"`
	// Specifies whether to enable storage encryption for the new global database
	// cluster.
	//
	// Constraints:
	//
	//   - Can't be specified if SourceDBClusterIdentifier is specified. In this
	//     case, Amazon Aurora uses the setting from the source DB cluster.
	StorageEncrypted *bool `json:"storageEncrypted,omitempty"`
}

// GlobalClusterStatus defines the observed state of GlobalCluster
type GlobalClusterStatus 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"`
	// The life cycle type for the global cluster.
	//
	// For more information, see CreateGlobalCluster.
	// +kubebuilder:validation:Optional
	EngineLifecycleSupport *string `json:"engineLifecycleSupport,omitempty"`
	// A data object containing all properties for the current state of an in-process
	// or pending switchover or failover process for this global cluster (Aurora
	// global database). This object is empty unless the SwitchoverGlobalCluster
	// or FailoverGlobalCluster operation was called on this global cluster.
	// +kubebuilder:validation:Optional
	FailoverState *FailoverState `json:"failoverState,omitempty"`
	// The list of primary and secondary clusters within the global database cluster.
	// +kubebuilder:validation:Optional
	GlobalClusterMembers []*GlobalClusterMember `json:"globalClusterMembers,omitempty"`
	// The Amazon Web Services Region-unique, immutable identifier for the global
	// database cluster. This identifier is found in Amazon Web Services CloudTrail
	// log entries whenever the Amazon Web Services KMS key for the DB cluster is
	// accessed.
	// +kubebuilder:validation:Optional
	GlobalClusterResourceID *string `json:"globalClusterResourceID,omitempty"`
	// Specifies the current state of this global database cluster.
	// +kubebuilder:validation:Optional
	Status *string `json:"status,omitempty"`
}

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

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

func init() {
	SchemeBuilder.Register(&GlobalCluster{}, &GlobalClusterList{})
}
