// *** 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.outputs;

import com.pulumi.core.annotations.CustomType;
import com.pulumi.gcp.kms.outputs.GetKMSCryptoKeyVersionPublicKey;
import java.lang.Integer;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;

@CustomType
public final class GetKMSCryptoKeyVersionResult {
    /**
     * @return The CryptoKeyVersionAlgorithm that this CryptoKeyVersion supports.
     * 
     */
    private String algorithm;
    private String cryptoKey;
    /**
     * @return The provider-assigned unique ID for this managed resource.
     * 
     */
    private String id;
    /**
     * @return The resource name for this CryptoKeyVersion in the format `projects/*{@literal /}locations/*{@literal /}keyRings/*{@literal /}cryptoKeys/*{@literal /}cryptoKeyVersions/*`
     * 
     */
    private String name;
    /**
     * @return The ProtectionLevel describing how crypto operations are performed with this CryptoKeyVersion. See the [protection_level reference](https://cloud.google.com/kms/docs/reference/rest/v1/ProtectionLevel) for possible outputs.
     * 
     */
    private String protectionLevel;
    /**
     * @return If the enclosing CryptoKey has purpose `ASYMMETRIC_SIGN` or `ASYMMETRIC_DECRYPT`, this block contains details about the public key associated to this CryptoKeyVersion. Structure is documented below.
     * 
     */
    private List<GetKMSCryptoKeyVersionPublicKey> publicKeys;
    /**
     * @return The current state of the CryptoKeyVersion. See the [state reference](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys.cryptoKeyVersions#CryptoKeyVersion.CryptoKeyVersionState) for possible outputs.
     * 
     */
    private String state;
    private @Nullable Integer version;

    private GetKMSCryptoKeyVersionResult() {}
    /**
     * @return The CryptoKeyVersionAlgorithm that this CryptoKeyVersion supports.
     * 
     */
    public String algorithm() {
        return this.algorithm;
    }
    public String cryptoKey() {
        return this.cryptoKey;
    }
    /**
     * @return The provider-assigned unique ID for this managed resource.
     * 
     */
    public String id() {
        return this.id;
    }
    /**
     * @return The resource name for this CryptoKeyVersion in the format `projects/*{@literal /}locations/*{@literal /}keyRings/*{@literal /}cryptoKeys/*{@literal /}cryptoKeyVersions/*`
     * 
     */
    public String name() {
        return this.name;
    }
    /**
     * @return The ProtectionLevel describing how crypto operations are performed with this CryptoKeyVersion. See the [protection_level reference](https://cloud.google.com/kms/docs/reference/rest/v1/ProtectionLevel) for possible outputs.
     * 
     */
    public String protectionLevel() {
        return this.protectionLevel;
    }
    /**
     * @return If the enclosing CryptoKey has purpose `ASYMMETRIC_SIGN` or `ASYMMETRIC_DECRYPT`, this block contains details about the public key associated to this CryptoKeyVersion. Structure is documented below.
     * 
     */
    public List<GetKMSCryptoKeyVersionPublicKey> publicKeys() {
        return this.publicKeys;
    }
    /**
     * @return The current state of the CryptoKeyVersion. See the [state reference](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys.cryptoKeyVersions#CryptoKeyVersion.CryptoKeyVersionState) for possible outputs.
     * 
     */
    public String state() {
        return this.state;
    }
    public Optional<Integer> version() {
        return Optional.ofNullable(this.version);
    }

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

    public static Builder builder(GetKMSCryptoKeyVersionResult defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private String algorithm;
        private String cryptoKey;
        private String id;
        private String name;
        private String protectionLevel;
        private List<GetKMSCryptoKeyVersionPublicKey> publicKeys;
        private String state;
        private @Nullable Integer version;
        public Builder() {}
        public Builder(GetKMSCryptoKeyVersionResult defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.algorithm = defaults.algorithm;
    	      this.cryptoKey = defaults.cryptoKey;
    	      this.id = defaults.id;
    	      this.name = defaults.name;
    	      this.protectionLevel = defaults.protectionLevel;
    	      this.publicKeys = defaults.publicKeys;
    	      this.state = defaults.state;
    	      this.version = defaults.version;
        }

        @CustomType.Setter
        public Builder algorithm(String algorithm) {
            this.algorithm = Objects.requireNonNull(algorithm);
            return this;
        }
        @CustomType.Setter
        public Builder cryptoKey(String cryptoKey) {
            this.cryptoKey = Objects.requireNonNull(cryptoKey);
            return this;
        }
        @CustomType.Setter
        public Builder id(String id) {
            this.id = Objects.requireNonNull(id);
            return this;
        }
        @CustomType.Setter
        public Builder name(String name) {
            this.name = Objects.requireNonNull(name);
            return this;
        }
        @CustomType.Setter
        public Builder protectionLevel(String protectionLevel) {
            this.protectionLevel = Objects.requireNonNull(protectionLevel);
            return this;
        }
        @CustomType.Setter
        public Builder publicKeys(List<GetKMSCryptoKeyVersionPublicKey> publicKeys) {
            this.publicKeys = Objects.requireNonNull(publicKeys);
            return this;
        }
        public Builder publicKeys(GetKMSCryptoKeyVersionPublicKey... publicKeys) {
            return publicKeys(List.of(publicKeys));
        }
        @CustomType.Setter
        public Builder state(String state) {
            this.state = Objects.requireNonNull(state);
            return this;
        }
        @CustomType.Setter
        public Builder version(@Nullable Integer version) {
            this.version = version;
            return this;
        }
        public GetKMSCryptoKeyVersionResult build() {
            final var o = new GetKMSCryptoKeyVersionResult();
            o.algorithm = algorithm;
            o.cryptoKey = cryptoKey;
            o.id = id;
            o.name = name;
            o.protectionLevel = protectionLevel;
            o.publicKeys = publicKeys;
            o.state = state;
            o.version = version;
            return o;
        }
    }
}
