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

// DBProxySpec defines the desired state of DBProxy.
//
// The data structure representing a proxy managed by the RDS Proxy.
//
// This data type is used as a response element in the DescribeDBProxies action.
type DBProxySpec struct {

	// The authorization mechanism that the proxy uses.
	// +kubebuilder:validation:Required
	Auth []*UserAuthConfig `json:"auth"`
	// Specifies whether the proxy includes detailed information about SQL statements
	// in its logs. This information helps you to debug issues involving SQL behavior
	// or the performance and scalability of the proxy connections. The debug information
	// includes the text of SQL statements that you submit through the proxy. Thus,
	// only enable this setting when needed for debugging, and only when you have
	// security measures in place to safeguard any sensitive information that appears
	// in the logs.
	DebugLogging *bool `json:"debugLogging,omitempty"`
	// The kinds of databases that the proxy can connect to. This value determines
	// which database network protocol the proxy recognizes when it interprets network
	// traffic to and from the database. For Aurora MySQL, RDS for MariaDB, and
	// RDS for MySQL databases, specify MYSQL. For Aurora PostgreSQL and RDS for
	// PostgreSQL databases, specify POSTGRESQL. For RDS for Microsoft SQL Server,
	// specify SQLSERVER.
	// +kubebuilder:validation:Required
	EngineFamily *string `json:"engineFamily"`
	// The number of seconds that a connection to the proxy can be inactive before
	// the proxy disconnects it. You can set this value higher or lower than the
	// connection timeout limit for the associated database.
	IdleClientTimeout *int64 `json:"idleClientTimeout,omitempty"`
	// The identifier for the proxy. This name must be unique for all proxies owned
	// by your Amazon Web Services account in the specified Amazon Web Services
	// Region. An identifier must begin with a letter and must contain only ASCII
	// letters, digits, and hyphens; it can't end with a hyphen or contain two consecutive
	// hyphens.
	// +kubebuilder:validation:Required
	Name *string `json:"name"`
	// Specifies whether Transport Layer Security (TLS) encryption is required for
	// connections to the proxy. By enabling this setting, you can enforce encrypted
	// TLS connections to the proxy.
	RequireTLS *bool `json:"requireTLS,omitempty"`
	// The Amazon Resource Name (ARN) of the IAM role that the proxy uses to access
	// secrets in Amazon Web Services Secrets Manager.
	// +kubebuilder:validation:Required
	RoleARN *string `json:"roleARN"`
	// An optional set of key-value pairs to associate arbitrary data of your choosing
	// with the proxy.
	Tags []*Tag `json:"tags,omitempty"`
	// One or more VPC security group IDs to associate with the new proxy.
	VPCSecurityGroupIDs []*string `json:"vpcSecurityGroupIDs,omitempty"`
	// One or more VPC subnet IDs to associate with the new proxy.
	// +kubebuilder:validation:Required
	VPCSubnetIDs []*string `json:"vpcSubnetIDs"`
}

// DBProxyStatus defines the observed state of DBProxy
type DBProxyStatus 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 date and time when the proxy was first created.
	// +kubebuilder:validation:Optional
	CreatedDate *metav1.Time `json:"createdDate,omitempty"`
	// The endpoint that you can use to connect to the DB proxy. You include the
	// endpoint value in the connection string for a database client application.
	// +kubebuilder:validation:Optional
	Endpoint *string `json:"endpoint,omitempty"`
	// The current status of this proxy. A status of available means the proxy is
	// ready to handle requests. Other values indicate that you must wait for the
	// proxy to be ready, or take some action to resolve an issue.
	// +kubebuilder:validation:Optional
	Status *string `json:"status,omitempty"`
	// The date and time when the proxy was last updated.
	// +kubebuilder:validation:Optional
	UpdatedDate *metav1.Time `json:"updatedDate,omitempty"`
	// Provides the VPC ID of the DB proxy.
	// +kubebuilder:validation:Optional
	VPCID *string `json:"vpcID,omitempty"`
}

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

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

func init() {
	SchemeBuilder.Register(&DBProxy{}, &DBProxyList{})
}
