package v1alpha1

import (
	spec "github.com/go-openapi/spec"
	common "k8s.io/kube-openapi/pkg/common"
)

func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition {
	return map[string]common.OpenAPIDefinition{
		"./pkg/apis/dynatrace/v1alpha1.OneAgent":       schema_pkg_apis_dynatrace_v1alpha1_OneAgent(ref),
		"./pkg/apis/dynatrace/v1alpha1.OneAgentSpec":   schema_pkg_apis_dynatrace_v1alpha1_OneAgentSpec(ref),
		"./pkg/apis/dynatrace/v1alpha1.OneAgentStatus": schema_pkg_apis_dynatrace_v1alpha1_OneAgentStatus(ref),
	}
}

func schema_pkg_apis_dynatrace_v1alpha1_OneAgent(ref common.ReferenceCallback) common.OpenAPIDefinition {
	return common.OpenAPIDefinition{
		Schema: spec.Schema{
			SchemaProps: spec.SchemaProps{
				Description: "OneAgent is the Schema for the oneagents API",
				Type:        []string{"object"},
				Properties: map[string]spec.Schema{
					"kind": {
						SchemaProps: spec.SchemaProps{
							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:
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"apiVersion": {
						SchemaProps: spec.SchemaProps{
							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:
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"metadata": {
						SchemaProps: spec.SchemaProps{
							Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"),
						},
					},
					"spec": {
						SchemaProps: spec.SchemaProps{
							Ref: ref("./pkg/apis/dynatrace/v1alpha1.OneAgentSpec"),
						},
					},
					"status": {
						SchemaProps: spec.SchemaProps{
							Ref: ref("./pkg/apis/dynatrace/v1alpha1.OneAgentStatus"),
						},
					},
				},
				Required: []string{"spec"},
			},
		},
		Dependencies: []string{
			"./pkg/apis/dynatrace/v1alpha1.OneAgentSpec", "./pkg/apis/dynatrace/v1alpha1.OneAgentStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"},
	}
}

func schema_pkg_apis_dynatrace_v1alpha1_OneAgentSpec(ref common.ReferenceCallback) common.OpenAPIDefinition {
	return common.OpenAPIDefinition{
		Schema: spec.Schema{
			SchemaProps: spec.SchemaProps{
				Description: "OneAgentSpec defines the desired state of OneAgent",
				Type:        []string{"object"},
				Properties: map[string]spec.Schema{
					"apiUrl": {
						SchemaProps: spec.SchemaProps{
							Description: "Dynatrace api url including `/api` path at the end either set ENVIRONMENTID to the proper tenant id or change the apiUrl as a whole, e.q. for Managed",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"skipCertCheck": {
						SchemaProps: spec.SchemaProps{
							Description: "Disable certificate validation checks for installer download and API communication",
							Type:        []string{"boolean"},
							Format:      "",
						},
					},
					"nodeSelector": {
						SchemaProps: spec.SchemaProps{
							Description: "Node selector to control the selection of nodes (optional)",
							Type:        []string{"object"},
							AdditionalProperties: &spec.SchemaOrBool{
								Allows: true,
								Schema: &spec.Schema{
									SchemaProps: spec.SchemaProps{
										Type:   []string{"string"},
										Format: "",
									},
								},
							},
						},
					},
					"tolerations": {
						VendorExtensible: spec.VendorExtensible{
							Extensions: spec.Extensions{
								"x-kubernetes-list-type": "set",
							},
						},
						SchemaProps: spec.SchemaProps{
							Description: "https:
							Type:        []string{"array"},
							Items: &spec.SchemaOrArray{
								Schema: &spec.Schema{
									SchemaProps: spec.SchemaProps{
										Ref: ref("k8s.io/api/core/v1.Toleration"),
									},
								},
							},
						},
					},
					"waitReadySeconds": {
						SchemaProps: spec.SchemaProps{
							Description: "Defines the time to wait until OneAgent pod is ready after update - default 300 sec (optional)",
							Type:        []string{"integer"},
							Format:      "int32",
						},
					},
					"image": {
						SchemaProps: spec.SchemaProps{
							Description: "Installer image Defaults to docker.io/dynatrace/oneagent:latest",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"tokens": {
						SchemaProps: spec.SchemaProps{
							Description: "Name of secret containing tokens Secret must contain keys `apiToken` and `paasToken`",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"args": {
						VendorExtensible: spec.VendorExtensible{
							Extensions: spec.Extensions{
								"x-kubernetes-list-type": "set",
							},
						},
						SchemaProps: spec.SchemaProps{
							Description: "Arguments to the installer.",
							Type:        []string{"array"},
							Items: &spec.SchemaOrArray{
								Schema: &spec.Schema{
									SchemaProps: spec.SchemaProps{
										Type:   []string{"string"},
										Format: "",
									},
								},
							},
						},
					},
					"env": {
						VendorExtensible: spec.VendorExtensible{
							Extensions: spec.Extensions{
								"x-kubernetes-list-type": "set",
							},
						},
						SchemaProps: spec.SchemaProps{
							Description: "List of environment variables to set for the installer.",
							Type:        []string{"array"},
							Items: &spec.SchemaOrArray{
								Schema: &spec.Schema{
									SchemaProps: spec.SchemaProps{
										Ref: ref("k8s.io/api/core/v1.EnvVar"),
									},
								},
							},
						},
					},
					"resources": {
						SchemaProps: spec.SchemaProps{
							Description: "Compute Resources required by OneAgent containers.",
							Ref:         ref("k8s.io/api/core/v1.ResourceRequirements"),
						},
					},
					"priorityClassName": {
						SchemaProps: spec.SchemaProps{
							Description: "If specified, indicates the pod's priority. Name must be defined by creating a PriorityClass object with that name. If not specified the setting will be removed from the DaemonSet.",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"disableAgentUpdate": {
						SchemaProps: spec.SchemaProps{
							Description: "If enabled, OneAgent pods won't be restarted automatically in case a new version is available",
							Type:        []string{"boolean"},
							Format:      "",
						},
					},
					"enableIstio": {
						SchemaProps: spec.SchemaProps{
							Description: "If enabled, Istio on the cluster will be configured automatically to allow access to the Dynatrace environment.",
							Type:        []string{"boolean"},
							Format:      "",
						},
					},
					"dnsPolicy": {
						SchemaProps: spec.SchemaProps{
							Description: "DNS Policy for the OneAgent pods.",
							Type:        []string{"string"},
							Format:      "",
						},
					},
				},
				Required: []string{"apiUrl"},
			},
		},
		Dependencies: []string{
			"k8s.io/api/core/v1.EnvVar", "k8s.io/api/core/v1.ResourceRequirements", "k8s.io/api/core/v1.Toleration"},
	}
}

func schema_pkg_apis_dynatrace_v1alpha1_OneAgentStatus(ref common.ReferenceCallback) common.OpenAPIDefinition {
	return common.OpenAPIDefinition{
		Schema: spec.Schema{
			SchemaProps: spec.SchemaProps{
				Description: "OneAgentStatus defines the observed state of OneAgent",
				Type:        []string{"object"},
				Properties: map[string]spec.Schema{
					"version": {
						SchemaProps: spec.SchemaProps{
							Type:   []string{"string"},
							Format: "",
						},
					},
					"instances": {
						SchemaProps: spec.SchemaProps{
							Type: []string{"object"},
							AdditionalProperties: &spec.SchemaOrBool{
								Allows: true,
								Schema: &spec.Schema{
									SchemaProps: spec.SchemaProps{
										Ref: ref("./pkg/apis/dynatrace/v1alpha1.OneAgentInstance"),
									},
								},
							},
						},
					},
					"updatedTimestamp": {
						SchemaProps: spec.SchemaProps{
							Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"),
						},
					},
					"phase": {
						SchemaProps: spec.SchemaProps{
							Description: "Defines the current state (Running, Updating, Error, ...)",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"conditions": {
						VendorExtensible: spec.VendorExtensible{
							Extensions: spec.Extensions{
								"x-kubernetes-list-type": "set",
							},
						},
						SchemaProps: spec.SchemaProps{
							Type: []string{"array"},
							Items: &spec.SchemaOrArray{
								Schema: &spec.Schema{
									SchemaProps: spec.SchemaProps{
										Ref: ref("./pkg/apis/dynatrace/v1alpha1.OneAgentCondition"),
									},
								},
							},
						},
					},
				},
			},
		},
		Dependencies: []string{
			"./pkg/apis/dynatrace/v1alpha1.OneAgentCondition", "./pkg/apis/dynatrace/v1alpha1.OneAgentInstance", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"},
	}
}
// +build !ignore_autogenerated

// This file was autogenerated by openapi-gen. Do not edit it manually!

package v1alpha1

import (
	spec "github.com/go-openapi/spec"
	common "k8s.io/kube-openapi/pkg/common"
)

func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition {
	return map[string]common.OpenAPIDefinition{
		"./pkg/apis/dynatrace/v1alpha1.OneAgent":       schema_pkg_apis_dynatrace_v1alpha1_OneAgent(ref),
		"./pkg/apis/dynatrace/v1alpha1.OneAgentSpec":   schema_pkg_apis_dynatrace_v1alpha1_OneAgentSpec(ref),
		"./pkg/apis/dynatrace/v1alpha1.OneAgentStatus": schema_pkg_apis_dynatrace_v1alpha1_OneAgentStatus(ref),
	}
}

func schema_pkg_apis_dynatrace_v1alpha1_OneAgent(ref common.ReferenceCallback) common.OpenAPIDefinition {
	return common.OpenAPIDefinition{
		Schema: spec.Schema{
			SchemaProps: spec.SchemaProps{
				Description: "OneAgent is the Schema for the oneagents API",
				Type:        []string{"object"},
				Properties: map[string]spec.Schema{
					"kind": {
						SchemaProps: spec.SchemaProps{
							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/api-conventions.md#types-kinds",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"apiVersion": {
						SchemaProps: spec.SchemaProps{
							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/api-conventions.md#resources",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"metadata": {
						SchemaProps: spec.SchemaProps{
							Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"),
						},
					},
					"spec": {
						SchemaProps: spec.SchemaProps{
							Ref: ref("./pkg/apis/dynatrace/v1alpha1.OneAgentSpec"),
						},
					},
					"status": {
						SchemaProps: spec.SchemaProps{
							Ref: ref("./pkg/apis/dynatrace/v1alpha1.OneAgentStatus"),
						},
					},
				},
				Required: []string{"spec"},
			},
		},
		Dependencies: []string{
			"./pkg/apis/dynatrace/v1alpha1.OneAgentSpec", "./pkg/apis/dynatrace/v1alpha1.OneAgentStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"},
	}
}

func schema_pkg_apis_dynatrace_v1alpha1_OneAgentSpec(ref common.ReferenceCallback) common.OpenAPIDefinition {
	return common.OpenAPIDefinition{
		Schema: spec.Schema{
			SchemaProps: spec.SchemaProps{
				Description: "OneAgentSpec defines the desired state of OneAgent",
				Type:        []string{"object"},
				Properties: map[string]spec.Schema{
					"apiUrl": {
						SchemaProps: spec.SchemaProps{
							Description: "Dynatrace api url including `/api` path at the end either set ENVIRONMENTID to the proper tenant id or change the apiUrl as a whole, e.q. for Managed",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"skipCertCheck": {
						SchemaProps: spec.SchemaProps{
							Description: "Disable certificate validation checks for installer download and API communication",
							Type:        []string{"boolean"},
							Format:      "",
						},
					},
					"nodeSelector": {
						SchemaProps: spec.SchemaProps{
							Description: "Node selector to control the selection of nodes (optional)",
							Type:        []string{"object"},
							AdditionalProperties: &spec.SchemaOrBool{
								Allows: true,
								Schema: &spec.Schema{
									SchemaProps: spec.SchemaProps{
										Type:   []string{"string"},
										Format: "",
									},
								},
							},
						},
					},
					"tolerations": {
						VendorExtensible: spec.VendorExtensible{
							Extensions: spec.Extensions{
								"x-kubernetes-list-type": "set",
							},
						},
						SchemaProps: spec.SchemaProps{
							Description: "https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ (optional)",
							Type:        []string{"array"},
							Items: &spec.SchemaOrArray{
								Schema: &spec.Schema{
									SchemaProps: spec.SchemaProps{
										Ref: ref("k8s.io/api/core/v1.Toleration"),
									},
								},
							},
						},
					},
					"waitReadySeconds": {
						SchemaProps: spec.SchemaProps{
							Description: "Defines the time to wait until OneAgent pod is ready after update - default 300 sec (optional)",
							Type:        []string{"integer"},
							Format:      "int32",
						},
					},
					"image": {
						SchemaProps: spec.SchemaProps{
							Description: "Installer image Defaults to docker.io/dynatrace/oneagent:latest",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"tokens": {
						SchemaProps: spec.SchemaProps{
							Description: "Name of secret containing tokens Secret must contain keys `apiToken` and `paasToken`",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"args": {
						VendorExtensible: spec.VendorExtensible{
							Extensions: spec.Extensions{
								"x-kubernetes-list-type": "set",
							},
						},
						SchemaProps: spec.SchemaProps{
							Description: "Arguments to the installer.",
							Type:        []string{"array"},
							Items: &spec.SchemaOrArray{
								Schema: &spec.Schema{
									SchemaProps: spec.SchemaProps{
										Type:   []string{"string"},
										Format: "",
									},
								},
							},
						},
					},
					"env": {
						VendorExtensible: spec.VendorExtensible{
							Extensions: spec.Extensions{
								"x-kubernetes-list-type": "set",
							},
						},
						SchemaProps: spec.SchemaProps{
							Description: "List of environment variables to set for the installer.",
							Type:        []string{"array"},
							Items: &spec.SchemaOrArray{
								Schema: &spec.Schema{
									SchemaProps: spec.SchemaProps{
										Ref: ref("k8s.io/api/core/v1.EnvVar"),
									},
								},
							},
						},
					},
					"resources": {
						SchemaProps: spec.SchemaProps{
							Description: "Compute Resources required by OneAgent containers.",
							Ref:         ref("k8s.io/api/core/v1.ResourceRequirements"),
						},
					},
					"priorityClassName": {
						SchemaProps: spec.SchemaProps{
							Description: "If specified, indicates the pod's priority. Name must be defined by creating a PriorityClass object with that name. If not specified the setting will be removed from the DaemonSet.",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"disableAgentUpdate": {
						SchemaProps: spec.SchemaProps{
							Description: "If enabled, OneAgent pods won't be restarted automatically in case a new version is available",
							Type:        []string{"boolean"},
							Format:      "",
						},
					},
					"enableIstio": {
						SchemaProps: spec.SchemaProps{
							Description: "If enabled, Istio on the cluster will be configured automatically to allow access to the Dynatrace environment.",
							Type:        []string{"boolean"},
							Format:      "",
						},
					},
					"dnsPolicy": {
						SchemaProps: spec.SchemaProps{
							Description: "DNS Policy for the OneAgent pods.",
							Type:        []string{"string"},
							Format:      "",
						},
					},
				},
				Required: []string{"apiUrl"},
			},
		},
		Dependencies: []string{
			"k8s.io/api/core/v1.EnvVar", "k8s.io/api/core/v1.ResourceRequirements", "k8s.io/api/core/v1.Toleration"},
	}
}

func schema_pkg_apis_dynatrace_v1alpha1_OneAgentStatus(ref common.ReferenceCallback) common.OpenAPIDefinition {
	return common.OpenAPIDefinition{
		Schema: spec.Schema{
			SchemaProps: spec.SchemaProps{
				Description: "OneAgentStatus defines the observed state of OneAgent",
				Type:        []string{"object"},
				Properties: map[string]spec.Schema{
					"version": {
						SchemaProps: spec.SchemaProps{
							Type:   []string{"string"},
							Format: "",
						},
					},
					"instances": {
						SchemaProps: spec.SchemaProps{
							Type: []string{"object"},
							AdditionalProperties: &spec.SchemaOrBool{
								Allows: true,
								Schema: &spec.Schema{
									SchemaProps: spec.SchemaProps{
										Ref: ref("./pkg/apis/dynatrace/v1alpha1.OneAgentInstance"),
									},
								},
							},
						},
					},
					"updatedTimestamp": {
						SchemaProps: spec.SchemaProps{
							Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"),
						},
					},
					"phase": {
						SchemaProps: spec.SchemaProps{
							Description: "Defines the current state (Running, Updating, Error, ...)",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"conditions": {
						VendorExtensible: spec.VendorExtensible{
							Extensions: spec.Extensions{
								"x-kubernetes-list-type": "set",
							},
						},
						SchemaProps: spec.SchemaProps{
							Type: []string{"array"},
							Items: &spec.SchemaOrArray{
								Schema: &spec.Schema{
									SchemaProps: spec.SchemaProps{
										Ref: ref("./pkg/apis/dynatrace/v1alpha1.OneAgentCondition"),
									},
								},
							},
						},
					},
				},
			},
		},
		Dependencies: []string{
			"./pkg/apis/dynatrace/v1alpha1.OneAgentCondition", "./pkg/apis/dynatrace/v1alpha1.OneAgentInstance", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"},
	}
}
