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

// ServiceLinkedRoleSpec defines the desired state of ServiceLinkedRole.
type ServiceLinkedRoleSpec struct {

	// The service principal for the Amazon Web Services service to which this role
	// is attached. You use a string similar to a URL but without the http:// in
	// front. For example: elasticbeanstalk.amazonaws.com.
	//
	// Service principals are unique and case-sensitive. To find the exact service
	// principal for your service-linked role, see Amazon Web Services services
	// that work with IAM (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-services-that-work-with-iam.html)
	// in the IAM User Guide. Look for the services that have Yes in the Service-Linked
	// Role column. Choose the Yes link to view the service-linked role documentation
	// for that service.
	//
	// Regex Pattern: `^[\w+=,.@-]+$`
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable once set"
	// +kubebuilder:validation:Required
	AWSServiceName *string `json:"awsServiceName"`
	// A string that you provide, which is combined with the service-provided prefix
	// to form the complete role name. If you make multiple requests for the same
	// service, then you must supply a different CustomSuffix for each request.
	// Otherwise the request fails with a duplicate role name error. For example,
	// you could add -1 or -debug to the suffix.
	//
	// Some services do not support the CustomSuffix parameter. If you provide an
	// optional suffix and the operation fails, try the operation again without
	// the suffix.
	//
	// Regex Pattern: `^[\w+=,.@-]+$`
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable once set"
	CustomSuffix *string `json:"customSuffix,omitempty"`
	// The description of the role.
	//
	// Regex Pattern: `^[\u0009\u000A\u000D\u0020-\u007E\u00A1-\u00FF]*$`
	Description *string `json:"description,omitempty"`
}

// ServiceLinkedRoleStatus defines the observed state of ServiceLinkedRole
type ServiceLinkedRoleStatus 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 policy that grants an entity permission to assume the role.
	//
	// Regex Pattern: `^[\u0009\u000A\u000D\u0020-\u00FF]+$`
	// +kubebuilder:validation:Optional
	AssumeRolePolicyDocument *string `json:"assumeRolePolicyDocument,omitempty"`
	// The date and time, in ISO 8601 date-time format (http://www.iso.org/iso/iso8601),
	// when the role was created.
	// +kubebuilder:validation:Optional
	CreateDate *metav1.Time `json:"createDate,omitempty"`
	// The maximum session duration (in seconds) for the specified role. Anyone
	// who uses the CLI, or API to assume the role can specify the duration using
	// the optional DurationSeconds API parameter or duration-seconds CLI parameter.
	// +kubebuilder:validation:Optional
	MaxSessionDuration *int64 `json:"maxSessionDuration,omitempty"`
	// The path to the role. For more information about paths, see IAM identifiers
	// (https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html)
	// in the IAM User Guide.
	//
	// Regex Pattern: `^(\u002F)|(\u002F[\u0021-\u007E]+\u002F)$`
	// +kubebuilder:validation:Optional
	Path *string `json:"path,omitempty"`
	// The ARN of the policy used to set the permissions boundary for the role.
	//
	// For more information about permissions boundaries, see Permissions boundaries
	// for IAM identities (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_boundaries.html)
	// in the IAM User Guide.
	// +kubebuilder:validation:Optional
	PermissionsBoundary *AttachedPermissionsBoundary `json:"permissionsBoundary,omitempty"`
	// The stable and unique string identifying the role. For more information about
	// IDs, see IAM identifiers (https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html)
	// in the IAM User Guide.
	//
	// Regex Pattern: `^[\w]+$`
	// +kubebuilder:validation:Optional
	RoleID *string `json:"roleID,omitempty"`
	// Contains information about the last time that an IAM role was used. This
	// includes the date and time and the Region in which the role was last used.
	// Activity is only reported for the trailing 400 days. This period can be shorter
	// if your Region began supporting these features within the last year. The
	// role might have been used more than 400 days ago. For more information, see
	// Regions where data is tracked (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_access-advisor.html#access-advisor_tracking-period)
	// in the IAM user Guide.
	// +kubebuilder:validation:Optional
	RoleLastUsed *RoleLastUsed `json:"roleLastUsed,omitempty"`
	// The friendly name that identifies the role.
	//
	// Regex Pattern: `^[\w+=,.@-]+$`
	// +kubebuilder:validation:Optional
	RoleName *string `json:"roleName,omitempty"`
	// A list of tags that are attached to the role. For more information about
	// tagging, see Tagging IAM resources (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_tags.html)
	// in the IAM User Guide.
	// +kubebuilder:validation:Optional
	Tags []*Tag `json:"tags,omitempty"`
}

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

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

func init() {
	SchemeBuilder.Register(&ServiceLinkedRole{}, &ServiceLinkedRoleList{})
}
