All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.kubernetes.apiextensions.v1.outputs.CustomResourceDefinitionSpecPatch Maven / Gradle / Ivy

There is a newer version: 4.19.0-alpha.1730750641
Show newest version
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.kubernetes.apiextensions.v1.outputs;

import com.pulumi.core.annotations.CustomType;
import com.pulumi.kubernetes.apiextensions.v1.outputs.CustomResourceConversionPatch;
import com.pulumi.kubernetes.apiextensions.v1.outputs.CustomResourceDefinitionNamesPatch;
import com.pulumi.kubernetes.apiextensions.v1.outputs.CustomResourceDefinitionVersionPatch;
import java.lang.Boolean;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;

@CustomType
public final class CustomResourceDefinitionSpecPatch {
    /**
     * @return conversion defines conversion settings for the CRD.
     * 
     */
    private @Nullable CustomResourceConversionPatch conversion;
    /**
     * @return group is the API group of the defined custom resource. The custom resources are served under `/apis/<group>/...`. Must match the name of the CustomResourceDefinition (in the form `<names.plural>.<group>`).
     * 
     */
    private @Nullable String group;
    /**
     * @return names specify the resource and kind names for the custom resource.
     * 
     */
    private @Nullable CustomResourceDefinitionNamesPatch names;
    /**
     * @return preserveUnknownFields indicates that object fields which are not specified in the OpenAPI schema should be preserved when persisting to storage. apiVersion, kind, metadata and known fields inside metadata are always preserved. This field is deprecated in favor of setting `x-preserve-unknown-fields` to true in `spec.versions[*].schema.openAPIV3Schema`. See https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#field-pruning for details.
     * 
     */
    private @Nullable Boolean preserveUnknownFields;
    /**
     * @return scope indicates whether the defined custom resource is cluster- or namespace-scoped. Allowed values are `Cluster` and `Namespaced`.
     * 
     */
    private @Nullable String scope;
    /**
     * @return versions is the list of all API versions of the defined custom resource. Version names are used to compute the order in which served versions are listed in API discovery. If the version string is "kube-like", it will sort above non "kube-like" version strings, which are ordered lexicographically. "Kube-like" versions start with a "v", then are followed by a number (the major version), then optionally the string "alpha" or "beta" and another number (the minor version). These are sorted first by GA > beta > alpha (where GA is a version with no suffix such as beta or alpha), and then by comparing major version, then minor version. An example sorted list of versions: v10, v2, v1, v11beta2, v10beta3, v3beta1, v12alpha1, v11alpha2, foo1, foo10.
     * 
     */
    private @Nullable List versions;

    private CustomResourceDefinitionSpecPatch() {}
    /**
     * @return conversion defines conversion settings for the CRD.
     * 
     */
    public Optional conversion() {
        return Optional.ofNullable(this.conversion);
    }
    /**
     * @return group is the API group of the defined custom resource. The custom resources are served under `/apis/<group>/...`. Must match the name of the CustomResourceDefinition (in the form `<names.plural>.<group>`).
     * 
     */
    public Optional group() {
        return Optional.ofNullable(this.group);
    }
    /**
     * @return names specify the resource and kind names for the custom resource.
     * 
     */
    public Optional names() {
        return Optional.ofNullable(this.names);
    }
    /**
     * @return preserveUnknownFields indicates that object fields which are not specified in the OpenAPI schema should be preserved when persisting to storage. apiVersion, kind, metadata and known fields inside metadata are always preserved. This field is deprecated in favor of setting `x-preserve-unknown-fields` to true in `spec.versions[*].schema.openAPIV3Schema`. See https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#field-pruning for details.
     * 
     */
    public Optional preserveUnknownFields() {
        return Optional.ofNullable(this.preserveUnknownFields);
    }
    /**
     * @return scope indicates whether the defined custom resource is cluster- or namespace-scoped. Allowed values are `Cluster` and `Namespaced`.
     * 
     */
    public Optional scope() {
        return Optional.ofNullable(this.scope);
    }
    /**
     * @return versions is the list of all API versions of the defined custom resource. Version names are used to compute the order in which served versions are listed in API discovery. If the version string is "kube-like", it will sort above non "kube-like" version strings, which are ordered lexicographically. "Kube-like" versions start with a "v", then are followed by a number (the major version), then optionally the string "alpha" or "beta" and another number (the minor version). These are sorted first by GA > beta > alpha (where GA is a version with no suffix such as beta or alpha), and then by comparing major version, then minor version. An example sorted list of versions: v10, v2, v1, v11beta2, v10beta3, v3beta1, v12alpha1, v11alpha2, foo1, foo10.
     * 
     */
    public List versions() {
        return this.versions == null ? List.of() : this.versions;
    }

    public static Builder builder() {
        return new Builder();
    }

    public static Builder builder(CustomResourceDefinitionSpecPatch defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable CustomResourceConversionPatch conversion;
        private @Nullable String group;
        private @Nullable CustomResourceDefinitionNamesPatch names;
        private @Nullable Boolean preserveUnknownFields;
        private @Nullable String scope;
        private @Nullable List versions;
        public Builder() {}
        public Builder(CustomResourceDefinitionSpecPatch defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.conversion = defaults.conversion;
    	      this.group = defaults.group;
    	      this.names = defaults.names;
    	      this.preserveUnknownFields = defaults.preserveUnknownFields;
    	      this.scope = defaults.scope;
    	      this.versions = defaults.versions;
        }

        @CustomType.Setter
        public Builder conversion(@Nullable CustomResourceConversionPatch conversion) {

            this.conversion = conversion;
            return this;
        }
        @CustomType.Setter
        public Builder group(@Nullable String group) {

            this.group = group;
            return this;
        }
        @CustomType.Setter
        public Builder names(@Nullable CustomResourceDefinitionNamesPatch names) {

            this.names = names;
            return this;
        }
        @CustomType.Setter
        public Builder preserveUnknownFields(@Nullable Boolean preserveUnknownFields) {

            this.preserveUnknownFields = preserveUnknownFields;
            return this;
        }
        @CustomType.Setter
        public Builder scope(@Nullable String scope) {

            this.scope = scope;
            return this;
        }
        @CustomType.Setter
        public Builder versions(@Nullable List versions) {

            this.versions = versions;
            return this;
        }
        public Builder versions(CustomResourceDefinitionVersionPatch... versions) {
            return versions(List.of(versions));
        }
        public CustomResourceDefinitionSpecPatch build() {
            final var _resultValue = new CustomResourceDefinitionSpecPatch();
            _resultValue.conversion = conversion;
            _resultValue.group = group;
            _resultValue.names = names;
            _resultValue.preserveUnknownFields = preserveUnknownFields;
            _resultValue.scope = scope;
            _resultValue.versions = versions;
            return _resultValue;
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy