// *** 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.gcp.kms.inputs;

import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.gcp.kms.inputs.CryptoKeyVersionTemplateArgs;
import java.lang.Boolean;
import java.lang.String;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


public final class CryptoKeyState extends com.pulumi.resources.ResourceArgs {

    public static final CryptoKeyState Empty = new CryptoKeyState();

    /**
     * The period of time that versions of this key spend in the DESTROY_SCHEDULED state before transitioning to DESTROYED.
     * If not specified at creation time, the default duration is 24 hours.
     * 
     */
    @Import(name="destroyScheduledDuration")
    private @Nullable Output<String> destroyScheduledDuration;

    /**
     * @return The period of time that versions of this key spend in the DESTROY_SCHEDULED state before transitioning to DESTROYED.
     * If not specified at creation time, the default duration is 24 hours.
     * 
     */
    public Optional<Output<String>> destroyScheduledDuration() {
        return Optional.ofNullable(this.destroyScheduledDuration);
    }

    /**
     * Whether this key may contain imported versions only.
     * 
     */
    @Import(name="importOnly")
    private @Nullable Output<Boolean> importOnly;

    /**
     * @return Whether this key may contain imported versions only.
     * 
     */
    public Optional<Output<Boolean>> importOnly() {
        return Optional.ofNullable(this.importOnly);
    }

    /**
     * The KeyRing that this key belongs to.
     * Format: `&#39;projects/{{project}}/locations/{{location}}/keyRings/{{keyRing}}&#39;`.
     * 
     * ***
     * 
     */
    @Import(name="keyRing")
    private @Nullable Output<String> keyRing;

    /**
     * @return The KeyRing that this key belongs to.
     * Format: `&#39;projects/{{project}}/locations/{{location}}/keyRings/{{keyRing}}&#39;`.
     * 
     * ***
     * 
     */
    public Optional<Output<String>> keyRing() {
        return Optional.ofNullable(this.keyRing);
    }

    /**
     * Labels with user-defined metadata to apply to this resource.
     * 
     */
    @Import(name="labels")
    private @Nullable Output<Map<String,String>> labels;

    /**
     * @return Labels with user-defined metadata to apply to this resource.
     * 
     */
    public Optional<Output<Map<String,String>>> labels() {
        return Optional.ofNullable(this.labels);
    }

    /**
     * The resource name for the CryptoKey.
     * 
     */
    @Import(name="name")
    private @Nullable Output<String> name;

    /**
     * @return The resource name for the CryptoKey.
     * 
     */
    public Optional<Output<String>> name() {
        return Optional.ofNullable(this.name);
    }

    /**
     * The immutable purpose of this CryptoKey. See the
     * [purpose reference](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys#CryptoKeyPurpose)
     * for possible inputs.
     * Default value is &#34;ENCRYPT_DECRYPT&#34;.
     * 
     */
    @Import(name="purpose")
    private @Nullable Output<String> purpose;

    /**
     * @return The immutable purpose of this CryptoKey. See the
     * [purpose reference](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys#CryptoKeyPurpose)
     * for possible inputs.
     * Default value is &#34;ENCRYPT_DECRYPT&#34;.
     * 
     */
    public Optional<Output<String>> purpose() {
        return Optional.ofNullable(this.purpose);
    }

    /**
     * Every time this period passes, generate a new CryptoKeyVersion and set it as the primary.
     * The first rotation will take place after the specified period. The rotation period has
     * the format of a decimal number with up to 9 fractional digits, followed by the
     * letter `s` (seconds). It must be greater than a day (ie, 86400).
     * 
     */
    @Import(name="rotationPeriod")
    private @Nullable Output<String> rotationPeriod;

    /**
     * @return Every time this period passes, generate a new CryptoKeyVersion and set it as the primary.
     * The first rotation will take place after the specified period. The rotation period has
     * the format of a decimal number with up to 9 fractional digits, followed by the
     * letter `s` (seconds). It must be greater than a day (ie, 86400).
     * 
     */
    public Optional<Output<String>> rotationPeriod() {
        return Optional.ofNullable(this.rotationPeriod);
    }

    /**
     * If set to true, the request will create a CryptoKey without any CryptoKeyVersions.
     * You must use the `gcp.kms.KeyRingImportJob` resource to import the CryptoKeyVersion.
     * 
     */
    @Import(name="skipInitialVersionCreation")
    private @Nullable Output<Boolean> skipInitialVersionCreation;

    /**
     * @return If set to true, the request will create a CryptoKey without any CryptoKeyVersions.
     * You must use the `gcp.kms.KeyRingImportJob` resource to import the CryptoKeyVersion.
     * 
     */
    public Optional<Output<Boolean>> skipInitialVersionCreation() {
        return Optional.ofNullable(this.skipInitialVersionCreation);
    }

    /**
     * A template describing settings for new crypto key versions.
     * Structure is documented below.
     * 
     */
    @Import(name="versionTemplate")
    private @Nullable Output<CryptoKeyVersionTemplateArgs> versionTemplate;

    /**
     * @return A template describing settings for new crypto key versions.
     * Structure is documented below.
     * 
     */
    public Optional<Output<CryptoKeyVersionTemplateArgs>> versionTemplate() {
        return Optional.ofNullable(this.versionTemplate);
    }

    private CryptoKeyState() {}

    private CryptoKeyState(CryptoKeyState $) {
        this.destroyScheduledDuration = $.destroyScheduledDuration;
        this.importOnly = $.importOnly;
        this.keyRing = $.keyRing;
        this.labels = $.labels;
        this.name = $.name;
        this.purpose = $.purpose;
        this.rotationPeriod = $.rotationPeriod;
        this.skipInitialVersionCreation = $.skipInitialVersionCreation;
        this.versionTemplate = $.versionTemplate;
    }

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

    public static final class Builder {
        private CryptoKeyState $;

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

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

        /**
         * @param destroyScheduledDuration The period of time that versions of this key spend in the DESTROY_SCHEDULED state before transitioning to DESTROYED.
         * If not specified at creation time, the default duration is 24 hours.
         * 
         * @return builder
         * 
         */
        public Builder destroyScheduledDuration(@Nullable Output<String> destroyScheduledDuration) {
            $.destroyScheduledDuration = destroyScheduledDuration;
            return this;
        }

        /**
         * @param destroyScheduledDuration The period of time that versions of this key spend in the DESTROY_SCHEDULED state before transitioning to DESTROYED.
         * If not specified at creation time, the default duration is 24 hours.
         * 
         * @return builder
         * 
         */
        public Builder destroyScheduledDuration(String destroyScheduledDuration) {
            return destroyScheduledDuration(Output.of(destroyScheduledDuration));
        }

        /**
         * @param importOnly Whether this key may contain imported versions only.
         * 
         * @return builder
         * 
         */
        public Builder importOnly(@Nullable Output<Boolean> importOnly) {
            $.importOnly = importOnly;
            return this;
        }

        /**
         * @param importOnly Whether this key may contain imported versions only.
         * 
         * @return builder
         * 
         */
        public Builder importOnly(Boolean importOnly) {
            return importOnly(Output.of(importOnly));
        }

        /**
         * @param keyRing The KeyRing that this key belongs to.
         * Format: `&#39;projects/{{project}}/locations/{{location}}/keyRings/{{keyRing}}&#39;`.
         * 
         * ***
         * 
         * @return builder
         * 
         */
        public Builder keyRing(@Nullable Output<String> keyRing) {
            $.keyRing = keyRing;
            return this;
        }

        /**
         * @param keyRing The KeyRing that this key belongs to.
         * Format: `&#39;projects/{{project}}/locations/{{location}}/keyRings/{{keyRing}}&#39;`.
         * 
         * ***
         * 
         * @return builder
         * 
         */
        public Builder keyRing(String keyRing) {
            return keyRing(Output.of(keyRing));
        }

        /**
         * @param labels Labels with user-defined metadata to apply to this resource.
         * 
         * @return builder
         * 
         */
        public Builder labels(@Nullable Output<Map<String,String>> labels) {
            $.labels = labels;
            return this;
        }

        /**
         * @param labels Labels with user-defined metadata to apply to this resource.
         * 
         * @return builder
         * 
         */
        public Builder labels(Map<String,String> labels) {
            return labels(Output.of(labels));
        }

        /**
         * @param name The resource name for the CryptoKey.
         * 
         * @return builder
         * 
         */
        public Builder name(@Nullable Output<String> name) {
            $.name = name;
            return this;
        }

        /**
         * @param name The resource name for the CryptoKey.
         * 
         * @return builder
         * 
         */
        public Builder name(String name) {
            return name(Output.of(name));
        }

        /**
         * @param purpose The immutable purpose of this CryptoKey. See the
         * [purpose reference](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys#CryptoKeyPurpose)
         * for possible inputs.
         * Default value is &#34;ENCRYPT_DECRYPT&#34;.
         * 
         * @return builder
         * 
         */
        public Builder purpose(@Nullable Output<String> purpose) {
            $.purpose = purpose;
            return this;
        }

        /**
         * @param purpose The immutable purpose of this CryptoKey. See the
         * [purpose reference](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys#CryptoKeyPurpose)
         * for possible inputs.
         * Default value is &#34;ENCRYPT_DECRYPT&#34;.
         * 
         * @return builder
         * 
         */
        public Builder purpose(String purpose) {
            return purpose(Output.of(purpose));
        }

        /**
         * @param rotationPeriod Every time this period passes, generate a new CryptoKeyVersion and set it as the primary.
         * The first rotation will take place after the specified period. The rotation period has
         * the format of a decimal number with up to 9 fractional digits, followed by the
         * letter `s` (seconds). It must be greater than a day (ie, 86400).
         * 
         * @return builder
         * 
         */
        public Builder rotationPeriod(@Nullable Output<String> rotationPeriod) {
            $.rotationPeriod = rotationPeriod;
            return this;
        }

        /**
         * @param rotationPeriod Every time this period passes, generate a new CryptoKeyVersion and set it as the primary.
         * The first rotation will take place after the specified period. The rotation period has
         * the format of a decimal number with up to 9 fractional digits, followed by the
         * letter `s` (seconds). It must be greater than a day (ie, 86400).
         * 
         * @return builder
         * 
         */
        public Builder rotationPeriod(String rotationPeriod) {
            return rotationPeriod(Output.of(rotationPeriod));
        }

        /**
         * @param skipInitialVersionCreation If set to true, the request will create a CryptoKey without any CryptoKeyVersions.
         * You must use the `gcp.kms.KeyRingImportJob` resource to import the CryptoKeyVersion.
         * 
         * @return builder
         * 
         */
        public Builder skipInitialVersionCreation(@Nullable Output<Boolean> skipInitialVersionCreation) {
            $.skipInitialVersionCreation = skipInitialVersionCreation;
            return this;
        }

        /**
         * @param skipInitialVersionCreation If set to true, the request will create a CryptoKey without any CryptoKeyVersions.
         * You must use the `gcp.kms.KeyRingImportJob` resource to import the CryptoKeyVersion.
         * 
         * @return builder
         * 
         */
        public Builder skipInitialVersionCreation(Boolean skipInitialVersionCreation) {
            return skipInitialVersionCreation(Output.of(skipInitialVersionCreation));
        }

        /**
         * @param versionTemplate A template describing settings for new crypto key versions.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder versionTemplate(@Nullable Output<CryptoKeyVersionTemplateArgs> versionTemplate) {
            $.versionTemplate = versionTemplate;
            return this;
        }

        /**
         * @param versionTemplate A template describing settings for new crypto key versions.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder versionTemplate(CryptoKeyVersionTemplateArgs versionTemplate) {
            return versionTemplate(Output.of(versionTemplate));
        }

        public CryptoKeyState build() {
            return $;
        }
    }

}
