// Code generated by azure-service-operator-codegen. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
package arm

import "github.com/Azure/azure-service-operator/v2/pkg/genruntime"

type FluxConfiguration_Spec struct {
	Name string `json:"name,omitempty"`

	// Properties: Properties to create a Flux Configuration resource
	Properties *FluxConfiguration_Properties_Spec `json:"properties,omitempty"`
}

var _ genruntime.ARMResourceSpec = &FluxConfiguration_Spec{}

// GetAPIVersion returns the ARM API version of the resource. This is always "2024-11-01"
func (configuration FluxConfiguration_Spec) GetAPIVersion() string {
	return "2024-11-01"
}

// GetName returns the Name of the resource
func (configuration *FluxConfiguration_Spec) GetName() string {
	return configuration.Name
}

// GetType returns the ARM Type of the resource. This is always "Microsoft.KubernetesConfiguration/fluxConfigurations"
func (configuration *FluxConfiguration_Spec) GetType() string {
	return "Microsoft.KubernetesConfiguration/fluxConfigurations"
}

type FluxConfiguration_Properties_Spec struct {
	// AzureBlob: Parameters to reconcile to the AzureBlob source kind type.
	AzureBlob *AzureBlobDefinition `json:"azureBlob,omitempty"`

	// Bucket: Parameters to reconcile to the Bucket source kind type.
	Bucket *BucketDefinition `json:"bucket,omitempty"`

	// ConfigurationProtectedSettings: Key-value pairs of protected configuration settings for the configuration
	ConfigurationProtectedSettings map[string]string `json:"configurationProtectedSettings,omitempty"`

	// GitRepository: Parameters to reconcile to the GitRepository source kind type.
	GitRepository *GitRepositoryDefinition `json:"gitRepository,omitempty"`

	// Kustomizations: Array of kustomizations used to reconcile the artifact pulled by the source type on the cluster.
	Kustomizations map[string]KustomizationDefinition `json:"kustomizations,omitempty"`

	// Namespace: The namespace to which this configuration is installed to. Maximum of 253 lower case alphanumeric characters,
	// hyphen and period only.
	Namespace *string `json:"namespace,omitempty"`

	// OciRepository: Parameters to reconcile to the OCIRepository source kind type.
	OciRepository *OCIRepositoryDefinition `json:"ociRepository,omitempty"`

	// ReconciliationWaitDuration: Maximum duration to wait for flux configuration reconciliation. E.g PT1H, PT5M, P1D
	ReconciliationWaitDuration *string `json:"reconciliationWaitDuration,omitempty"`

	// Scope: Scope at which the operator will be installed.
	Scope *ScopeDefinition `json:"scope,omitempty"`

	// SourceKind: Source Kind to pull the configuration data from.
	SourceKind *SourceKindDefinition `json:"sourceKind,omitempty"`

	// Suspend: Whether this configuration should suspend its reconciliation of its kustomizations and sources.
	Suspend *bool `json:"suspend,omitempty"`

	// WaitForReconciliation: Whether flux configuration deployment should wait for cluster to reconcile the kustomizations.
	WaitForReconciliation *bool `json:"waitForReconciliation,omitempty"`
}

// Parameters to reconcile to the AzureBlob source kind type.
type AzureBlobDefinition struct {
	// AccountKey: The account key (shared key) to access the storage account
	AccountKey *string `json:"accountKey,omitempty"`

	// ContainerName: The Azure Blob container name to sync from the url endpoint for the flux configuration.
	ContainerName *string `json:"containerName,omitempty"`

	// LocalAuthRef: Name of a local secret on the Kubernetes cluster to use as the authentication secret rather than the
	// managed or user-provided configuration secrets.
	LocalAuthRef *string `json:"localAuthRef,omitempty"`

	// ManagedIdentity: Parameters to authenticate using a Managed Identity.
	ManagedIdentity *ManagedIdentityDefinition `json:"managedIdentity,omitempty"`

	// SasToken: The Shared Access token to access the storage container
	SasToken *string `json:"sasToken,omitempty"`

	// ServicePrincipal: Parameters to authenticate using Service Principal.
	ServicePrincipal *ServicePrincipalDefinition `json:"servicePrincipal,omitempty"`

	// SyncIntervalInSeconds: The interval at which to re-reconcile the cluster Azure Blob source with the remote.
	SyncIntervalInSeconds *int `json:"syncIntervalInSeconds,omitempty"`

	// TimeoutInSeconds: The maximum time to attempt to reconcile the cluster Azure Blob source with the remote.
	TimeoutInSeconds *int `json:"timeoutInSeconds,omitempty"`

	// Url: The URL to sync for the flux configuration Azure Blob storage account.
	Url *string `json:"url,omitempty"`
}

// Parameters to reconcile to the Bucket source kind type.
type BucketDefinition struct {
	// AccessKey: Plaintext access key used to securely access the S3 bucket
	AccessKey *string `json:"accessKey,omitempty"`

	// BucketName: The bucket name to sync from the url endpoint for the flux configuration.
	BucketName *string `json:"bucketName,omitempty"`

	// Insecure: Specify whether to use insecure communication when puling data from the S3 bucket.
	Insecure *bool `json:"insecure,omitempty"`

	// LocalAuthRef: Name of a local secret on the Kubernetes cluster to use as the authentication secret rather than the
	// managed or user-provided configuration secrets.
	LocalAuthRef *string `json:"localAuthRef,omitempty"`

	// SyncIntervalInSeconds: The interval at which to re-reconcile the cluster bucket source with the remote.
	SyncIntervalInSeconds *int `json:"syncIntervalInSeconds,omitempty"`

	// TimeoutInSeconds: The maximum time to attempt to reconcile the cluster bucket source with the remote.
	TimeoutInSeconds *int `json:"timeoutInSeconds,omitempty"`

	// Url: The URL to sync for the flux configuration S3 bucket.
	Url *string `json:"url,omitempty"`
}

// Parameters to reconcile to the GitRepository source kind type.
type GitRepositoryDefinition struct {
	// HttpsCACert: Base64-encoded HTTPS certificate authority contents used to access git private git repositories over HTTPS
	HttpsCACert *string `json:"httpsCACert,omitempty"`

	// HttpsUser: Plaintext HTTPS username used to access private git repositories over HTTPS
	HttpsUser *string `json:"httpsUser,omitempty"`

	// LocalAuthRef: Name of a local secret on the Kubernetes cluster to use as the authentication secret rather than the
	// managed or user-provided configuration secrets.
	LocalAuthRef *string `json:"localAuthRef,omitempty"`

	// Provider: Name of the provider used for authentication.
	Provider *GitRepositoryDefinition_Provider `json:"provider,omitempty"`

	// RepositoryRef: The source reference for the GitRepository object.
	RepositoryRef *RepositoryRefDefinition `json:"repositoryRef,omitempty"`

	// SshKnownHosts: Base64-encoded known_hosts value containing public SSH keys required to access private git repositories
	// over SSH
	SshKnownHosts *string `json:"sshKnownHosts,omitempty"`

	// SyncIntervalInSeconds: The interval at which to re-reconcile the cluster git repository source with the remote.
	SyncIntervalInSeconds *int `json:"syncIntervalInSeconds,omitempty"`

	// TimeoutInSeconds: The maximum time to attempt to reconcile the cluster git repository source with the remote.
	TimeoutInSeconds *int `json:"timeoutInSeconds,omitempty"`

	// Url: The URL to sync for the flux configuration git repository.
	Url *string `json:"url,omitempty"`
}

// The Kustomization defining how to reconcile the artifact pulled by the source type on the cluster.
type KustomizationDefinition struct {
	// DependsOn: Specifies other Kustomizations that this Kustomization depends on. This Kustomization will not reconcile
	// until all dependencies have completed their reconciliation.
	DependsOn []string `json:"dependsOn,omitempty"`

	// Force: Enable/disable re-creating Kubernetes resources on the cluster when patching fails due to an immutable field
	// change.
	Force *bool `json:"force,omitempty"`

	// Path: The path in the source reference to reconcile on the cluster.
	Path *string `json:"path,omitempty"`

	// PostBuild: Used for variable substitution for this Kustomization after kustomize build.
	PostBuild *PostBuildDefinition `json:"postBuild,omitempty"`

	// Prune: Enable/disable garbage collections of Kubernetes objects created by this Kustomization.
	Prune *bool `json:"prune,omitempty"`

	// RetryIntervalInSeconds: The interval at which to re-reconcile the Kustomization on the cluster in the event of failure
	// on reconciliation.
	RetryIntervalInSeconds *int `json:"retryIntervalInSeconds,omitempty"`

	// SyncIntervalInSeconds: The interval at which to re-reconcile the Kustomization on the cluster.
	SyncIntervalInSeconds *int `json:"syncIntervalInSeconds,omitempty"`

	// TimeoutInSeconds: The maximum time to attempt to reconcile the Kustomization on the cluster.
	TimeoutInSeconds *int `json:"timeoutInSeconds,omitempty"`

	// Wait: Enable/disable health check for all Kubernetes objects created by this Kustomization.
	Wait *bool `json:"wait,omitempty"`
}

// Parameters to reconcile to the OCIRepository source kind type.
type OCIRepositoryDefinition struct {
	// Insecure: Specify whether to allow connecting to a non-TLS HTTP container registry.
	Insecure *bool `json:"insecure,omitempty"`

	// LayerSelector: The layer to be pulled from the OCI artifact.
	LayerSelector *LayerSelectorDefinition `json:"layerSelector,omitempty"`

	// LocalAuthRef: Name of a local secret on the Kubernetes cluster to use as the authentication secret rather than the
	// managed or user-provided configuration secrets.
	LocalAuthRef *string `json:"localAuthRef,omitempty"`

	// RepositoryRef: The source reference for the OCIRepository object.
	RepositoryRef *OCIRepositoryRefDefinition `json:"repositoryRef,omitempty"`

	// ServiceAccountName: The service account name to authenticate with the OCI repository.
	ServiceAccountName *string `json:"serviceAccountName,omitempty"`

	// SyncIntervalInSeconds: The interval at which to re-reconcile the cluster OCI repository source with the remote.
	SyncIntervalInSeconds *int `json:"syncIntervalInSeconds,omitempty"`

	// TimeoutInSeconds: The maximum time to attempt to reconcile the cluster OCI repository source with the remote.
	TimeoutInSeconds *int `json:"timeoutInSeconds,omitempty"`

	// TlsConfig: Parameters to authenticate using TLS config for OCI repository.
	TlsConfig *TlsConfigDefinition `json:"tlsConfig,omitempty"`

	// Url: The URL to sync for the flux configuration OCI repository.
	Url *string `json:"url,omitempty"`

	// UseWorkloadIdentity: Specifies whether to use Workload Identity to authenticate with the OCI repository.
	UseWorkloadIdentity *bool `json:"useWorkloadIdentity,omitempty"`

	// Verify: Verification of the authenticity of an OCI Artifact.
	Verify *VerifyDefinition `json:"verify,omitempty"`
}

// Scope at which the configuration will be installed.
// +kubebuilder:validation:Enum={"cluster","namespace"}
type ScopeDefinition string

const (
	ScopeDefinition_Cluster   = ScopeDefinition("cluster")
	ScopeDefinition_Namespace = ScopeDefinition("namespace")
)

// Mapping from string to ScopeDefinition
var scopeDefinition_Values = map[string]ScopeDefinition{
	"cluster":   ScopeDefinition_Cluster,
	"namespace": ScopeDefinition_Namespace,
}

// Source Kind to pull the configuration data from.
// +kubebuilder:validation:Enum={"AzureBlob","Bucket","GitRepository","OCIRepository"}
type SourceKindDefinition string

const (
	SourceKindDefinition_AzureBlob     = SourceKindDefinition("AzureBlob")
	SourceKindDefinition_Bucket        = SourceKindDefinition("Bucket")
	SourceKindDefinition_GitRepository = SourceKindDefinition("GitRepository")
	SourceKindDefinition_OCIRepository = SourceKindDefinition("OCIRepository")
)

// Mapping from string to SourceKindDefinition
var sourceKindDefinition_Values = map[string]SourceKindDefinition{
	"azureblob":     SourceKindDefinition_AzureBlob,
	"bucket":        SourceKindDefinition_Bucket,
	"gitrepository": SourceKindDefinition_GitRepository,
	"ocirepository": SourceKindDefinition_OCIRepository,
}

// +kubebuilder:validation:Enum={"Azure","Generic"}
type GitRepositoryDefinition_Provider string

const (
	GitRepositoryDefinition_Provider_Azure   = GitRepositoryDefinition_Provider("Azure")
	GitRepositoryDefinition_Provider_Generic = GitRepositoryDefinition_Provider("Generic")
)

// Mapping from string to GitRepositoryDefinition_Provider
var gitRepositoryDefinition_Provider_Values = map[string]GitRepositoryDefinition_Provider{
	"azure":   GitRepositoryDefinition_Provider_Azure,
	"generic": GitRepositoryDefinition_Provider_Generic,
}

// Parameters to specify which layer to pull from the OCI artifact. By default, the first layer in the artifact is pulled.
type LayerSelectorDefinition struct {
	// MediaType: The first layer matching the specified media type will be used.
	MediaType *string `json:"mediaType,omitempty"`

	// Operation: The operation to be performed on the selected layer. The default value is 'extract', but it can be set to
	// 'copy'.
	Operation *OperationDefinition `json:"operation,omitempty"`
}

// Parameters to authenticate using a Managed Identity.
type ManagedIdentityDefinition struct {
	// ClientId: The client Id for authenticating a Managed Identity.
	ClientId *string `json:"clientId,omitempty"`
}

// The source reference for the OCIRepository object.
type OCIRepositoryRefDefinition struct {
	// Digest: The image digest to pull from OCI repository, the value should be in the format ‘sha256:’. This takes
	// precedence over semver.
	Digest *string `json:"digest,omitempty"`

	// Semver: The semver range used to match against OCI repository tags. This takes precedence over tag.
	Semver *string `json:"semver,omitempty"`

	// Tag: The OCI repository image tag name to pull. This defaults to 'latest'.
	Tag *string `json:"tag,omitempty"`
}

// The postBuild definitions defining variable substitutions for this Kustomization after kustomize build.
type PostBuildDefinition struct {
	// Substitute: Key/value pairs holding the variables to be substituted in this Kustomization.
	Substitute map[string]string `json:"substitute,omitempty"`

	// SubstituteFrom: Array of ConfigMaps/Secrets from which the variables are substituted for this Kustomization.
	SubstituteFrom []SubstituteFromDefinition `json:"substituteFrom,omitempty"`
}

// The source reference for the GitRepository object.
type RepositoryRefDefinition struct {
	// Branch: The git repository branch name to checkout.
	Branch *string `json:"branch,omitempty"`

	// Commit: The commit SHA to checkout. This value must be combined with the branch name to be valid. This takes precedence
	// over semver.
	Commit *string `json:"commit,omitempty"`

	// Semver: The semver range used to match against git repository tags. This takes precedence over tag.
	Semver *string `json:"semver,omitempty"`

	// Tag: The git repository tag name to checkout. This takes precedence over branch.
	Tag *string `json:"tag,omitempty"`
}

// Parameters to authenticate using Service Principal.
type ServicePrincipalDefinition struct {
	// ClientCertificate: Base64-encoded certificate used to authenticate a Service Principal
	ClientCertificate *string `json:"clientCertificate,omitempty"`

	// ClientCertificatePassword: The password for the certificate used to authenticate a Service Principal
	ClientCertificatePassword *string `json:"clientCertificatePassword,omitempty"`

	// ClientCertificateSendChain: Specifies whether to include x5c header in client claims when acquiring a token to enable
	// subject name / issuer based authentication for the Client Certificate
	ClientCertificateSendChain *bool `json:"clientCertificateSendChain,omitempty"`

	// ClientId: The client Id for authenticating a Service Principal.
	ClientId *string `json:"clientId,omitempty" optionalConfigMapPair:"ClientId"`

	// ClientSecret: The client secret for authenticating a Service Principal
	ClientSecret *string `json:"clientSecret,omitempty"`

	// TenantId: The tenant Id for authenticating a Service Principal
	TenantId *string `json:"tenantId,omitempty" optionalConfigMapPair:"TenantId"`
}

// Parameters to authenticate using TLS config for OCI repository.
type TlsConfigDefinition struct {
	// CaCertificate: Base64-encoded CA certificate used to verify the server.
	CaCertificate *string `json:"caCertificate,omitempty"`

	// ClientCertificate: Base64-encoded certificate used to authenticate a client with the OCI repository.
	ClientCertificate *string `json:"clientCertificate,omitempty"`

	// PrivateKey: Base64-encoded private key used to authenticate a client with the OCI repository.
	PrivateKey *string `json:"privateKey,omitempty"`
}

// Parameters to verify the authenticity of an OCI Artifact.
type VerifyDefinition struct {
	// MatchOidcIdentity: Array defining the criteria for matching the identity while verifying an OCI artifact.
	MatchOidcIdentity []MatchOidcIdentityDefinition `json:"matchOidcIdentity,omitempty"`

	// Provider: Verification provider name.
	Provider *string `json:"provider,omitempty"`

	// VerificationConfig: An object containing trusted public keys of trusted authors.
	VerificationConfig map[string]string `json:"verificationConfig,omitempty"`
}

// MatchOIDCIdentity defines the criteria for matching the identity while verifying an OCI artifact.
type MatchOidcIdentityDefinition struct {
	// Issuer: The regex pattern to match against to verify the OIDC issuer.
	Issuer *string `json:"issuer,omitempty"`

	// Subject: The regex pattern to match against to verify the identity subject.
	Subject *string `json:"subject,omitempty"`
}

// The operation to be performed on the selected layer. The default value is 'extract', but it can be set to 'copy'.
// +kubebuilder:validation:Enum={"copy","extract"}
type OperationDefinition string

const (
	OperationDefinition_Copy    = OperationDefinition("copy")
	OperationDefinition_Extract = OperationDefinition("extract")
)

// Mapping from string to OperationDefinition
var operationDefinition_Values = map[string]OperationDefinition{
	"copy":    OperationDefinition_Copy,
	"extract": OperationDefinition_Extract,
}

// Array of ConfigMaps/Secrets from which the variables are substituted for this Kustomization.
type SubstituteFromDefinition struct {
	// Kind: Define whether it is ConfigMap or Secret that holds the variables to be used in substitution.
	Kind *string `json:"kind,omitempty"`

	// Name: Name of the ConfigMap/Secret that holds the variables to be used in substitution.
	Name *string `json:"name,omitempty"`

	// Optional: Set to True to proceed without ConfigMap/Secret, if it is not present.
	Optional *bool `json:"optional,omitempty"`
}
