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

// DBClusterEndpointSpec defines the desired state of DBClusterEndpoint.
//
// This data type represents the information you need to connect to an Amazon
// Aurora DB cluster. This data type is used as a response element in the following
// actions:
//
//   - CreateDBClusterEndpoint
//
//   - DescribeDBClusterEndpoints
//
//   - ModifyDBClusterEndpoint
//
//   - DeleteDBClusterEndpoint
//
// For the data structure that represents Amazon RDS DB instance endpoints,
// see Endpoint.
type DBClusterEndpointSpec struct {

	// The identifier to use for the new endpoint. This parameter is stored as a
	// lowercase string.
	// +kubebuilder:validation:Required
	DBClusterEndpointIdentifier *string `json:"dbClusterEndpointIdentifier"`
	// The DB cluster identifier of the DB cluster associated with the endpoint.
	// This parameter is stored as a lowercase string.
	DBClusterIdentifier    *string                                  `json:"dbClusterIdentifier,omitempty"`
	DBClusterIdentifierRef *ackv1alpha1.AWSResourceReferenceWrapper `json:"dbClusterIdentifierRef,omitempty"`
	// The type of the endpoint, one of: READER, WRITER, ANY.
	EndpointType *string `json:"endpointType,omitempty"`
	// List of DB instance identifiers that aren't part of the custom endpoint group.
	// All other eligible instances are reachable through the custom endpoint. This
	// parameter is relevant only if the list of static members is empty.
	ExcludedMembers []*string `json:"excludedMembers,omitempty"`
	// List of DB instance identifiers that are part of the custom endpoint group.
	StaticMembers []*string `json:"staticMembers,omitempty"`
	// The tags to be assigned to the Amazon RDS resource.
	Tags []*Tag `json:"tags,omitempty"`
}

// DBClusterEndpointStatus defines the observed state of DBClusterEndpoint
type DBClusterEndpointStatus 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 unique system-generated identifier for an endpoint. It remains the same
	// for the whole life of the endpoint.
	// +kubebuilder:validation:Optional
	DBClusterEndpointResourceIdentifier *string `json:"dbClusterEndpointResourceIdentifier,omitempty"`
	// The DNS address of the endpoint.
	// +kubebuilder:validation:Optional
	Endpoint *string `json:"endpoint,omitempty"`
	// The current status of the endpoint. One of: creating, available, deleting,
	// inactive, modifying. The inactive state applies to an endpoint that can't
	// be used for a certain kind of cluster, such as a writer endpoint for a read-only
	// secondary cluster in a global database.
	// +kubebuilder:validation:Optional
	Status *string `json:"status,omitempty"`
}

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

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

func init() {
	SchemeBuilder.Register(&DBClusterEndpoint{}, &DBClusterEndpointList{})
}
