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

// DBSubnetGroupSpec defines the desired state of DBSubnetGroup.
//
// Contains the details of an Amazon RDS DB subnet group.
//
// This data type is used as a response element in the DescribeDBSubnetGroups
// action.
type DBSubnetGroupSpec struct {

	// The description for the DB subnet group.
	// +kubebuilder:validation:Required
	Description *string `json:"description"`
	// The name for the DB subnet group. This value is stored as a lowercase string.
	//
	// Constraints:
	//
	//   - Must contain no more than 255 letters, numbers, periods, underscores,
	//     spaces, or hyphens.
	//
	//   - Must not be default.
	//
	//   - First character must be a letter.
	//
	// Example: mydbsubnetgroup
	// +kubebuilder:validation:Required
	Name *string `json:"name"`
	// The EC2 Subnet IDs for the DB subnet group.
	SubnetIDs  []*string                                  `json:"subnetIDs,omitempty"`
	SubnetRefs []*ackv1alpha1.AWSResourceReferenceWrapper `json:"subnetRefs,omitempty"`
	// Tags to assign to the DB subnet group.
	Tags []*Tag `json:"tags,omitempty"`
}

// DBSubnetGroupStatus defines the observed state of DBSubnetGroup
type DBSubnetGroupStatus 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"`
	// Provides the status of the DB subnet group.
	// +kubebuilder:validation:Optional
	SubnetGroupStatus *string `json:"subnetGroupStatus,omitempty"`
	// Contains a list of Subnet elements.
	// +kubebuilder:validation:Optional
	Subnets []*Subnet `json:"subnets,omitempty"`
	// The network type of the DB subnet group.
	//
	// Valid values:
	//
	//    * IPV4
	//
	//    * DUAL
	//
	// A DBSubnetGroup can support only the IPv4 protocol or the IPv4 and the IPv6
	// protocols (DUAL).
	//
	// For more information, see Working with a DB instance in a VPC (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.WorkingWithRDSInstanceinaVPC.html)
	// in the Amazon RDS User Guide.
	// +kubebuilder:validation:Optional
	SupportedNetworkTypes []*string `json:"supportedNetworkTypes,omitempty"`
	// Provides the VpcId of the DB subnet group.
	// +kubebuilder:validation:Optional
	VPCID *string `json:"vpcID,omitempty"`
}

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

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

func init() {
	SchemeBuilder.Register(&DBSubnetGroup{}, &DBSubnetGroupList{})
}
