// 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 GcraccesstokensGeneratorsCrd = &apiextensionsv1.CustomResourceDefinition{
	ObjectMeta: metav1.ObjectMeta{
		Annotations: map[string]string{"controller-gen.kubebuilder.io/version": "v0.11.1"},
		Name:        "gcraccesstokens.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{"gcraccesstoken"},
			Kind:       "GCRAccessToken",
			ListKind:   "GCRAccessTokenList",
			Plural:     "gcraccesstokens",
			ShortNames: []string{"gcraccesstoken"},
			Singular:   "gcraccesstoken",
		},
		Scope: apiextensionsv1.ResourceScope("Namespaced"),
		Versions: []apiextensionsv1.CustomResourceDefinitionVersion{
			{
				Name: "v1alpha1",
				Schema: &apiextensionsv1.CustomResourceValidation{
					OpenAPIV3Schema: &apiextensionsv1.JSONSchemaProps{
						Description: "GCRAccessToken generates an GCP access token that can be used to authenticate with GCR.",
						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": {
								Properties: map[string]apiextensionsv1.JSONSchemaProps{
									"auth": {
										Description: "Auth defines the means for authenticating with GCP",
										Properties: map[string]apiextensionsv1.JSONSchemaProps{
											"secretRef": {
												Properties: map[string]apiextensionsv1.JSONSchemaProps{
													"secretAccessKeySecretRef": {
														Description: "The SecretAccessKey is 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",
											},
											"workloadIdentity": {
												Properties: map[string]apiextensionsv1.JSONSchemaProps{
													"clusterLocation":  {Type: "string"},
													"clusterName":      {Type: "string"},
													"clusterProjectID": {Type: "string"},
													"serviceAccountRef": {
														Description: "A reference to a ServiceAccount resource.",
														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",
													},
												},
												Required: []string{
													"clusterLocation",
													"clusterName",
													"serviceAccountRef",
												},
												Type: "object",
											},
										},
										Type: "object",
									},
									"projectID": {
										Description: "ProjectID defines which project to use to authenticate with",
										Type:        "string",
									},
								},
								Required: []string{"auth", "projectID"},
								Type:     "object",
							},
						},
						Type: "object",
					},
				},
				Served:       true,
				Storage:      true,
				Subresources: &apiextensionsv1.CustomResourceSubresources{},
			},
		},
	},
	TypeMeta: metav1.TypeMeta{
		APIVersion: "apiextensions.k8s.io/v1",
		Kind:       "CustomResourceDefinition",
	},
}
