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

import com.pulumi.core.annotations.CustomType;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;

@CustomType
public final class DiskSourceSnapshotEncryptionKey {
    /**
     * @return The self link of the encryption key used to encrypt the disk. Also called KmsKeyName
     * in the cloud console. Your project&#39;s Compute Engine System service account
     * (`service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com`) must have
     * `roles/cloudkms.cryptoKeyEncrypterDecrypter` to use this feature.
     * See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys
     * 
     */
    private @Nullable String kmsKeySelfLink;
    /**
     * @return The service account used for the encryption request for the given KMS key.
     * If absent, the Compute Engine Service Agent service account is used.
     * 
     */
    private @Nullable String kmsKeyServiceAccount;
    /**
     * @return Specifies a 256-bit customer-supplied encryption key, encoded in
     * RFC 4648 base64 to either encrypt or decrypt this resource.
     * 
     */
    private @Nullable String rawKey;
    /**
     * @return (Output)
     * The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied
     * encryption key that protects this resource.
     * 
     */
    private @Nullable String sha256;

    private DiskSourceSnapshotEncryptionKey() {}
    /**
     * @return The self link of the encryption key used to encrypt the disk. Also called KmsKeyName
     * in the cloud console. Your project&#39;s Compute Engine System service account
     * (`service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com`) must have
     * `roles/cloudkms.cryptoKeyEncrypterDecrypter` to use this feature.
     * See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys
     * 
     */
    public Optional<String> kmsKeySelfLink() {
        return Optional.ofNullable(this.kmsKeySelfLink);
    }
    /**
     * @return The service account used for the encryption request for the given KMS key.
     * If absent, the Compute Engine Service Agent service account is used.
     * 
     */
    public Optional<String> kmsKeyServiceAccount() {
        return Optional.ofNullable(this.kmsKeyServiceAccount);
    }
    /**
     * @return Specifies a 256-bit customer-supplied encryption key, encoded in
     * RFC 4648 base64 to either encrypt or decrypt this resource.
     * 
     */
    public Optional<String> rawKey() {
        return Optional.ofNullable(this.rawKey);
    }
    /**
     * @return (Output)
     * The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied
     * encryption key that protects this resource.
     * 
     */
    public Optional<String> sha256() {
        return Optional.ofNullable(this.sha256);
    }

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

    public static Builder builder(DiskSourceSnapshotEncryptionKey defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable String kmsKeySelfLink;
        private @Nullable String kmsKeyServiceAccount;
        private @Nullable String rawKey;
        private @Nullable String sha256;
        public Builder() {}
        public Builder(DiskSourceSnapshotEncryptionKey defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.kmsKeySelfLink = defaults.kmsKeySelfLink;
    	      this.kmsKeyServiceAccount = defaults.kmsKeyServiceAccount;
    	      this.rawKey = defaults.rawKey;
    	      this.sha256 = defaults.sha256;
        }

        @CustomType.Setter
        public Builder kmsKeySelfLink(@Nullable String kmsKeySelfLink) {
            this.kmsKeySelfLink = kmsKeySelfLink;
            return this;
        }
        @CustomType.Setter
        public Builder kmsKeyServiceAccount(@Nullable String kmsKeyServiceAccount) {
            this.kmsKeyServiceAccount = kmsKeyServiceAccount;
            return this;
        }
        @CustomType.Setter
        public Builder rawKey(@Nullable String rawKey) {
            this.rawKey = rawKey;
            return this;
        }
        @CustomType.Setter
        public Builder sha256(@Nullable String sha256) {
            this.sha256 = sha256;
            return this;
        }
        public DiskSourceSnapshotEncryptionKey build() {
            final var o = new DiskSourceSnapshotEncryptionKey();
            o.kmsKeySelfLink = kmsKeySelfLink;
            o.kmsKeyServiceAccount = kmsKeyServiceAccount;
            o.rawKey = rawKey;
            o.sha256 = sha256;
            return o;
        }
    }
}
