// Copyright (c) 2023 Volvo Car Corporation
// SPDX-License-Identifier: Apache-2.0

// Code generated by lingon. EDIT AS MUCH AS YOU LIKE.

package crd

import (
	apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

var AcraccesstokensGeneratorsCrd = &apiextensionsv1.CustomResourceDefinition{
	ObjectMeta: metav1.ObjectMeta{
		Annotations: map[string]string{"controller-gen.kubebuilder.io/version": "v0.11.1"},
		Name:        "acraccesstokens.generators.external-secrets.io",
	},
	Spec: apiextensionsv1.CustomResourceDefinitionSpec{
		Conversion: &apiextensionsv1.CustomResourceConversion{
			Strategy: apiextensionsv1.ConversionStrategyType("Webhook"),
			Webhook: &apiextensionsv1.WebhookConversion{
				ClientConfig: &apiextensionsv1.WebhookClientConfig{
					Service: &apiextensionsv1.ServiceReference{
						Name:      "external-secrets-webhook",
						Namespace: "external-secrets",
						Path:      P("/convert"),
					},
				},
				ConversionReviewVersions: []string{"v1"},
			},
		},
		Group: "generators.external-secrets.io",
		Names: apiextensionsv1.CustomResourceDefinitionNames{
			Categories: []string{"acraccesstoken"},
			Kind:       "ACRAccessToken",
			ListKind:   "ACRAccessTokenList",
			Plural:     "acraccesstokens",
			ShortNames: []string{"acraccesstoken"},
			Singular:   "acraccesstoken",
		},
		Scope: apiextensionsv1.ResourceScope("Namespaced"),
		Versions: []apiextensionsv1.CustomResourceDefinitionVersion{
			{
				Name: "v1alpha1",
				Schema: &apiextensionsv1.CustomResourceValidation{
					OpenAPIV3Schema: &apiextensionsv1.JSONSchemaProps{
						Description: "ACRAccessToken returns a Azure Container Registry token that can be used for pushing/pulling images. Note: by default it will return an ACR Refresh Token with full access (depending on the identity). This can be scoped down to the repository level using .spec.scope. In case scope is defined it will return an ACR Access Token. \n See docs: https://github.com/Azure/acr/blob/main/docs/AAD-OAuth.md",
						Properties: map[string]apiextensionsv1.JSONSchemaProps{
							"apiVersion": {
								Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
								Type:        "string",
							},
							"kind": {
								Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
								Type:        "string",
							},
							"metadata": {Type: "object"},
							"spec": {
								Description: "ACRAccessTokenSpec defines how to generate the access token e.g. how to authenticate and which registry to use. see: https://github.com/Azure/acr/blob/main/docs/AAD-OAuth.md#overview",
								Properties: map[string]apiextensionsv1.JSONSchemaProps{
									"auth": {
										Properties: map[string]apiextensionsv1.JSONSchemaProps{
											"managedIdentity": {
												Description: "ManagedIdentity uses Azure Managed Identity to authenticate with Azure.",
												Properties: map[string]apiextensionsv1.JSONSchemaProps{
													"identityId": {
														Description: "If multiple Managed Identity is assigned to the pod, you can select the one to be used",
														Type:        "string",
													},
												},
												Type: "object",
											},
											"servicePrincipal": {
												Description: "ServicePrincipal uses Azure Service Principal credentials to authenticate with Azure.",
												Properties: map[string]apiextensionsv1.JSONSchemaProps{
													"secretRef": {
														Description: "Configuration used to authenticate with Azure using static credentials stored in a Kind=Secret.",
														Properties: map[string]apiextensionsv1.JSONSchemaProps{
															"clientId": {
																Description: "The Azure clientId of the service principle used for authentication.",
																Properties: map[string]apiextensionsv1.JSONSchemaProps{
																	"key": {
																		Description: "The key of the entry in the Secret resource's `data` field to be used. Some instances of this field may be defaulted, in others it may be required.",
																		Type:        "string",
																	},
																	"name": {
																		Description: "The name of the Secret resource being referred to.",
																		Type:        "string",
																	},
																	"namespace": {
																		Description: "Namespace of the resource being referred to. Ignored if referent is not cluster-scoped. cluster-scoped defaults to the namespace of the referent.",
																		Type:        "string",
																	},
																},
																Type: "object",
															},
															"clientSecret": {
																Description: "The Azure ClientSecret of the service principle used for authentication.",
																Properties: map[string]apiextensionsv1.JSONSchemaProps{
																	"key": {
																		Description: "The key of the entry in the Secret resource's `data` field to be used. Some instances of this field may be defaulted, in others it may be required.",
																		Type:        "string",
																	},
																	"name": {
																		Description: "The name of the Secret resource being referred to.",
																		Type:        "string",
																	},
																	"namespace": {
																		Description: "Namespace of the resource being referred to. Ignored if referent is not cluster-scoped. cluster-scoped defaults to the namespace of the referent.",
																		Type:        "string",
																	},
																},
																Type: "object",
															},
														},
														Type: "object",
													},
												},
												Required: []string{"secretRef"},
												Type:     "object",
											},
											"workloadIdentity": {
												Description: "WorkloadIdentity uses Azure Workload Identity to authenticate with Azure.",
												Properties: map[string]apiextensionsv1.JSONSchemaProps{
													"serviceAccountRef": {
														Description: "ServiceAccountRef specified the service account that should be used when authenticating with WorkloadIdentity.",
														Properties: map[string]apiextensionsv1.JSONSchemaProps{
															"audiences": {
																Description: "Audience specifies the `aud` claim for the service account token If the service account uses a well-known annotation for e.g. IRSA or GCP Workload Identity then this audiences will be appended to the list",
																Items:       &apiextensionsv1.JSONSchemaPropsOrArray{Schema: &apiextensionsv1.JSONSchemaProps{Type: "string"}},
																Type:        "array",
															},
															"name": {
																Description: "The name of the ServiceAccount resource being referred to.",
																Type:        "string",
															},
															"namespace": {
																Description: "Namespace of the resource being referred to. Ignored if referent is not cluster-scoped. cluster-scoped defaults to the namespace of the referent.",
																Type:        "string",
															},
														},
														Required: []string{"name"},
														Type:     "object",
													},
												},
												Type: "object",
											},
										},
										Type: "object",
									},
									"environmentType": {
										Default: &apiextensionsv1.JSON{
											Raw: []uint8{
												uint8(0x22),
												uint8(0x50),
												uint8(0x75),
												uint8(0x62),
												uint8(0x6c),
												uint8(0x69),
												uint8(0x63),
												uint8(0x43),
												uint8(0x6c),
												uint8(0x6f),
												uint8(0x75),
												uint8(0x64),
												uint8(0x22),
											},
										},
										Description: "EnvironmentType specifies the Azure cloud environment endpoints to use for connecting and authenticating with Azure. By default it points to the public cloud AAD endpoint. The following endpoints are available, also see here: https://github.com/Azure/go-autorest/blob/main/autorest/azure/environments.go#L152 PublicCloud, USGovernmentCloud, ChinaCloud, GermanCloud",
										Enum: []apiextensionsv1.JSON{
											{
												Raw: []uint8{
													uint8(0x22),
													uint8(0x50),
													uint8(0x75),
													uint8(0x62),
													uint8(0x6c),
													uint8(0x69),
													uint8(0x63),
													uint8(0x43),
													uint8(0x6c),
													uint8(0x6f),
													uint8(0x75),
													uint8(0x64),
													uint8(0x22),
												},
											},
											{
												Raw: []uint8{
													uint8(0x22),
													uint8(0x55),
													uint8(0x53),
													uint8(0x47),
													uint8(0x6f),
													uint8(0x76),
													uint8(0x65),
													uint8(0x72),
													uint8(0x6e),
													uint8(0x6d),
													uint8(0x65),
													uint8(0x6e),
													uint8(0x74),
													uint8(0x43),
													uint8(0x6c),
													uint8(0x6f),
													uint8(0x75),
													uint8(0x64),
													uint8(0x22),
												},
											},
											{
												Raw: []uint8{
													uint8(0x22),
													uint8(0x43),
													uint8(0x68),
													uint8(0x69),
													uint8(0x6e),
													uint8(0x61),
													uint8(0x43),
													uint8(0x6c),
													uint8(0x6f),
													uint8(0x75),
													uint8(0x64),
													uint8(0x22),
												},
											},
											{
												Raw: []uint8{
													uint8(0x22),
													uint8(0x47),
													uint8(0x65),
													uint8(0x72),
													uint8(0x6d),
													uint8(0x61),
													uint8(0x6e),
													uint8(0x43),
													uint8(0x6c),
													uint8(0x6f),
													uint8(0x75),
													uint8(0x64),
													uint8(0x22),
												},
											},
										},
										Type: "string",
									},
									"registry": {
										Description: "the domain name of the ACR registry e.g. foobarexample.azurecr.io",
										Type:        "string",
									},
									"scope": {
										Description: "Define the scope for the access token, e.g. pull/push access for a repository. if not provided it will return a refresh token that has full scope. Note: you need to pin it down to the repository level, there is no wildcard available. \n examples: repository:my-repository:pull,push repository:my-repository:pull \n see docs for details: https://docs.docker.com/registry/spec/auth/scope/",
										Type:        "string",
									},
									"tenantId": {
										Description: "TenantID configures the Azure Tenant to send requests to. Required for ServicePrincipal auth type.",
										Type:        "string",
									},
								},
								Required: []string{"auth", "registry"},
								Type:     "object",
							},
						},
						Type: "object",
					},
				},
				Served:       true,
				Storage:      true,
				Subresources: &apiextensionsv1.CustomResourceSubresources{},
			},
		},
	},
	TypeMeta: metav1.TypeMeta{
		APIVersion: "apiextensions.k8s.io/v1",
		Kind:       "CustomResourceDefinition",
	},
}
