// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.databox.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Import disk details. */
@Fluent
public final class ImportDiskDetails {
    /*
     * The relative path of the manifest file on the disk.
     */
    @JsonProperty(value = "manifestFile", required = true)
    private String manifestFile;

    /*
     * The Base16-encoded MD5 hash of the manifest file on the disk.
     */
    @JsonProperty(value = "manifestHash", required = true)
    private String manifestHash;

    /*
     * BitLocker key used to encrypt the disk.
     */
    @JsonProperty(value = "bitLockerKey", required = true)
    private String bitLockerKey;

    /*
     * Path to backed up manifest, only returned if enableManifestBackup is true.
     */
    @JsonProperty(value = "backupManifestCloudPath", access = JsonProperty.Access.WRITE_ONLY)
    private String backupManifestCloudPath;

    /** Creates an instance of ImportDiskDetails class. */
    public ImportDiskDetails() {
    }

    /**
     * Get the manifestFile property: The relative path of the manifest file on the disk.
     *
     * @return the manifestFile value.
     */
    public String manifestFile() {
        return this.manifestFile;
    }

    /**
     * Set the manifestFile property: The relative path of the manifest file on the disk.
     *
     * @param manifestFile the manifestFile value to set.
     * @return the ImportDiskDetails object itself.
     */
    public ImportDiskDetails withManifestFile(String manifestFile) {
        this.manifestFile = manifestFile;
        return this;
    }

    /**
     * Get the manifestHash property: The Base16-encoded MD5 hash of the manifest file on the disk.
     *
     * @return the manifestHash value.
     */
    public String manifestHash() {
        return this.manifestHash;
    }

    /**
     * Set the manifestHash property: The Base16-encoded MD5 hash of the manifest file on the disk.
     *
     * @param manifestHash the manifestHash value to set.
     * @return the ImportDiskDetails object itself.
     */
    public ImportDiskDetails withManifestHash(String manifestHash) {
        this.manifestHash = manifestHash;
        return this;
    }

    /**
     * Get the bitLockerKey property: BitLocker key used to encrypt the disk.
     *
     * @return the bitLockerKey value.
     */
    public String bitLockerKey() {
        return this.bitLockerKey;
    }

    /**
     * Set the bitLockerKey property: BitLocker key used to encrypt the disk.
     *
     * @param bitLockerKey the bitLockerKey value to set.
     * @return the ImportDiskDetails object itself.
     */
    public ImportDiskDetails withBitLockerKey(String bitLockerKey) {
        this.bitLockerKey = bitLockerKey;
        return this;
    }

    /**
     * Get the backupManifestCloudPath property: Path to backed up manifest, only returned if enableManifestBackup is
     * true.
     *
     * @return the backupManifestCloudPath value.
     */
    public String backupManifestCloudPath() {
        return this.backupManifestCloudPath;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (manifestFile() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException("Missing required property manifestFile in model ImportDiskDetails"));
        }
        if (manifestHash() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException("Missing required property manifestHash in model ImportDiskDetails"));
        }
        if (bitLockerKey() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException("Missing required property bitLockerKey in model ImportDiskDetails"));
        }
    }

    private static final ClientLogger LOGGER = new ClientLogger(ImportDiskDetails.class);
}
