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

com.pulumi.kubernetes.apiextensions.v1beta1.inputs.CustomResourceConversionArgs 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.v1beta1.inputs;

import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import com.pulumi.kubernetes.apiextensions.v1beta1.inputs.WebhookClientConfigArgs;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


/**
 * CustomResourceConversion describes how to convert different versions of a CR.
 * 
 */
public final class CustomResourceConversionArgs extends com.pulumi.resources.ResourceArgs {

    public static final CustomResourceConversionArgs Empty = new CustomResourceConversionArgs();

    /**
     * conversionReviewVersions is an ordered list of preferred `ConversionReview` versions the Webhook expects. The API server will use the first version in the list which it supports. If none of the versions specified in this list are supported by API server, conversion will fail for the custom resource. If a persisted Webhook configuration specifies allowed versions and does not include any versions known to the API Server, calls to the webhook will fail. Defaults to `["v1beta1"]`.
     * 
     */
    @Import(name="conversionReviewVersions")
    private @Nullable Output> conversionReviewVersions;

    /**
     * @return conversionReviewVersions is an ordered list of preferred `ConversionReview` versions the Webhook expects. The API server will use the first version in the list which it supports. If none of the versions specified in this list are supported by API server, conversion will fail for the custom resource. If a persisted Webhook configuration specifies allowed versions and does not include any versions known to the API Server, calls to the webhook will fail. Defaults to `["v1beta1"]`.
     * 
     */
    public Optional>> conversionReviewVersions() {
        return Optional.ofNullable(this.conversionReviewVersions);
    }

    /**
     * strategy specifies how custom resources are converted between versions. Allowed values are: - `None`: The converter only change the apiVersion and would not touch any other field in the custom resource. - `Webhook`: API Server will call to an external webhook to do the conversion. Additional information
     *   is needed for this option. This requires spec.preserveUnknownFields to be false, and spec.conversion.webhookClientConfig to be set.
     * 
     */
    @Import(name="strategy", required=true)
    private Output strategy;

    /**
     * @return strategy specifies how custom resources are converted between versions. Allowed values are: - `None`: The converter only change the apiVersion and would not touch any other field in the custom resource. - `Webhook`: API Server will call to an external webhook to do the conversion. Additional information
     *   is needed for this option. This requires spec.preserveUnknownFields to be false, and spec.conversion.webhookClientConfig to be set.
     * 
     */
    public Output strategy() {
        return this.strategy;
    }

    /**
     * webhookClientConfig is the instructions for how to call the webhook if strategy is `Webhook`. Required when `strategy` is set to `Webhook`.
     * 
     */
    @Import(name="webhookClientConfig")
    private @Nullable Output webhookClientConfig;

    /**
     * @return webhookClientConfig is the instructions for how to call the webhook if strategy is `Webhook`. Required when `strategy` is set to `Webhook`.
     * 
     */
    public Optional> webhookClientConfig() {
        return Optional.ofNullable(this.webhookClientConfig);
    }

    private CustomResourceConversionArgs() {}

    private CustomResourceConversionArgs(CustomResourceConversionArgs $) {
        this.conversionReviewVersions = $.conversionReviewVersions;
        this.strategy = $.strategy;
        this.webhookClientConfig = $.webhookClientConfig;
    }

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

    public static final class Builder {
        private CustomResourceConversionArgs $;

        public Builder() {
            $ = new CustomResourceConversionArgs();
        }

        public Builder(CustomResourceConversionArgs defaults) {
            $ = new CustomResourceConversionArgs(Objects.requireNonNull(defaults));
        }

        /**
         * @param conversionReviewVersions conversionReviewVersions is an ordered list of preferred `ConversionReview` versions the Webhook expects. The API server will use the first version in the list which it supports. If none of the versions specified in this list are supported by API server, conversion will fail for the custom resource. If a persisted Webhook configuration specifies allowed versions and does not include any versions known to the API Server, calls to the webhook will fail. Defaults to `["v1beta1"]`.
         * 
         * @return builder
         * 
         */
        public Builder conversionReviewVersions(@Nullable Output> conversionReviewVersions) {
            $.conversionReviewVersions = conversionReviewVersions;
            return this;
        }

        /**
         * @param conversionReviewVersions conversionReviewVersions is an ordered list of preferred `ConversionReview` versions the Webhook expects. The API server will use the first version in the list which it supports. If none of the versions specified in this list are supported by API server, conversion will fail for the custom resource. If a persisted Webhook configuration specifies allowed versions and does not include any versions known to the API Server, calls to the webhook will fail. Defaults to `["v1beta1"]`.
         * 
         * @return builder
         * 
         */
        public Builder conversionReviewVersions(List conversionReviewVersions) {
            return conversionReviewVersions(Output.of(conversionReviewVersions));
        }

        /**
         * @param conversionReviewVersions conversionReviewVersions is an ordered list of preferred `ConversionReview` versions the Webhook expects. The API server will use the first version in the list which it supports. If none of the versions specified in this list are supported by API server, conversion will fail for the custom resource. If a persisted Webhook configuration specifies allowed versions and does not include any versions known to the API Server, calls to the webhook will fail. Defaults to `["v1beta1"]`.
         * 
         * @return builder
         * 
         */
        public Builder conversionReviewVersions(String... conversionReviewVersions) {
            return conversionReviewVersions(List.of(conversionReviewVersions));
        }

        /**
         * @param strategy strategy specifies how custom resources are converted between versions. Allowed values are: - `None`: The converter only change the apiVersion and would not touch any other field in the custom resource. - `Webhook`: API Server will call to an external webhook to do the conversion. Additional information
         *   is needed for this option. This requires spec.preserveUnknownFields to be false, and spec.conversion.webhookClientConfig to be set.
         * 
         * @return builder
         * 
         */
        public Builder strategy(Output strategy) {
            $.strategy = strategy;
            return this;
        }

        /**
         * @param strategy strategy specifies how custom resources are converted between versions. Allowed values are: - `None`: The converter only change the apiVersion and would not touch any other field in the custom resource. - `Webhook`: API Server will call to an external webhook to do the conversion. Additional information
         *   is needed for this option. This requires spec.preserveUnknownFields to be false, and spec.conversion.webhookClientConfig to be set.
         * 
         * @return builder
         * 
         */
        public Builder strategy(String strategy) {
            return strategy(Output.of(strategy));
        }

        /**
         * @param webhookClientConfig webhookClientConfig is the instructions for how to call the webhook if strategy is `Webhook`. Required when `strategy` is set to `Webhook`.
         * 
         * @return builder
         * 
         */
        public Builder webhookClientConfig(@Nullable Output webhookClientConfig) {
            $.webhookClientConfig = webhookClientConfig;
            return this;
        }

        /**
         * @param webhookClientConfig webhookClientConfig is the instructions for how to call the webhook if strategy is `Webhook`. Required when `strategy` is set to `Webhook`.
         * 
         * @return builder
         * 
         */
        public Builder webhookClientConfig(WebhookClientConfigArgs webhookClientConfig) {
            return webhookClientConfig(Output.of(webhookClientConfig));
        }

        public CustomResourceConversionArgs build() {
            if ($.strategy == null) {
                throw new MissingRequiredPropertyException("CustomResourceConversionArgs", "strategy");
            }
            return $;
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy