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

package com.azure.resourcemanager.storageimportexport.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Specifies the job properties. */
@Fluent
public final class JobDetails {
    /*
     * The resource identifier of the storage account where data will be imported to or exported from.
     */
    @JsonProperty(value = "storageAccountId")
    private String storageAccountId;

    /*
     * The type of job
     */
    @JsonProperty(value = "jobType")
    private String jobType;

    /*
     * Specifies the return address information for the job.
     */
    @JsonProperty(value = "returnAddress")
    private ReturnAddress returnAddress;

    /*
     * Specifies the return carrier and customer's account with the carrier.
     */
    @JsonProperty(value = "returnShipping")
    private ReturnShipping returnShipping;

    /*
     * Contains information about the Microsoft datacenter to which the drives should be shipped.
     */
    @JsonProperty(value = "shippingInformation")
    private ShippingInformation shippingInformation;

    /*
     * Contains information about the package being shipped by the customer to the Microsoft data center.
     */
    @JsonProperty(value = "deliveryPackage")
    private DeliveryPackageInformation deliveryPackage;

    /*
     * Contains information about the package being shipped from the Microsoft data center to the customer to return
     * the drives. The format is the same as the deliveryPackage property above. This property is not included if the
     * drives have not yet been returned.
     */
    @JsonProperty(value = "returnPackage")
    private PackageInformation returnPackage;

    /*
     * The virtual blob directory to which the copy logs and backups of drive manifest files (if enabled) will be
     * stored.
     */
    @JsonProperty(value = "diagnosticsPath")
    private String diagnosticsPath;

    /*
     * Default value is Error. Indicates whether error logging or verbose logging will be enabled.
     */
    @JsonProperty(value = "logLevel")
    private String logLevel;

    /*
     * Default value is false. Indicates whether the manifest files on the drives should be copied to block blobs.
     */
    @JsonProperty(value = "backupDriveManifest")
    private Boolean backupDriveManifest;

    /*
     * Current state of the job.
     */
    @JsonProperty(value = "state")
    private String state;

    /*
     * Indicates whether a request has been submitted to cancel the job.
     */
    @JsonProperty(value = "cancelRequested")
    private Boolean cancelRequested;

    /*
     * Overall percentage completed for the job.
     */
    @JsonProperty(value = "percentComplete")
    private Long percentComplete;

    /*
     * A blob path that points to a block blob containing a list of blob names that were not exported due to
     * insufficient drive space. If all blobs were exported successfully, then this element is not included in the
     * response.
     */
    @JsonProperty(value = "incompleteBlobListUri")
    private String incompleteBlobListUri;

    /*
     * List of up to ten drives that comprise the job. The drive list is a required element for an import job; it is
     * not specified for export jobs.
     */
    @JsonProperty(value = "driveList")
    private List<DriveStatus> driveList;

    /*
     * A property containing information about the blobs to be exported for an export job. This property is included
     * for export jobs only.
     */
    @JsonProperty(value = "export")
    private Export export;

    /*
     * Specifies the provisioning state of the job.
     */
    @JsonProperty(value = "provisioningState")
    private String provisioningState;

    /*
     * Contains information about the encryption key.
     */
    @JsonProperty(value = "encryptionKey")
    private EncryptionKeyDetails encryptionKey;

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

    /**
     * Get the storageAccountId property: The resource identifier of the storage account where data will be imported to
     * or exported from.
     *
     * @return the storageAccountId value.
     */
    public String storageAccountId() {
        return this.storageAccountId;
    }

    /**
     * Set the storageAccountId property: The resource identifier of the storage account where data will be imported to
     * or exported from.
     *
     * @param storageAccountId the storageAccountId value to set.
     * @return the JobDetails object itself.
     */
    public JobDetails withStorageAccountId(String storageAccountId) {
        this.storageAccountId = storageAccountId;
        return this;
    }

    /**
     * Get the jobType property: The type of job.
     *
     * @return the jobType value.
     */
    public String jobType() {
        return this.jobType;
    }

    /**
     * Set the jobType property: The type of job.
     *
     * @param jobType the jobType value to set.
     * @return the JobDetails object itself.
     */
    public JobDetails withJobType(String jobType) {
        this.jobType = jobType;
        return this;
    }

    /**
     * Get the returnAddress property: Specifies the return address information for the job.
     *
     * @return the returnAddress value.
     */
    public ReturnAddress returnAddress() {
        return this.returnAddress;
    }

    /**
     * Set the returnAddress property: Specifies the return address information for the job.
     *
     * @param returnAddress the returnAddress value to set.
     * @return the JobDetails object itself.
     */
    public JobDetails withReturnAddress(ReturnAddress returnAddress) {
        this.returnAddress = returnAddress;
        return this;
    }

    /**
     * Get the returnShipping property: Specifies the return carrier and customer's account with the carrier.
     *
     * @return the returnShipping value.
     */
    public ReturnShipping returnShipping() {
        return this.returnShipping;
    }

    /**
     * Set the returnShipping property: Specifies the return carrier and customer's account with the carrier.
     *
     * @param returnShipping the returnShipping value to set.
     * @return the JobDetails object itself.
     */
    public JobDetails withReturnShipping(ReturnShipping returnShipping) {
        this.returnShipping = returnShipping;
        return this;
    }

    /**
     * Get the shippingInformation property: Contains information about the Microsoft datacenter to which the drives
     * should be shipped.
     *
     * @return the shippingInformation value.
     */
    public ShippingInformation shippingInformation() {
        return this.shippingInformation;
    }

    /**
     * Set the shippingInformation property: Contains information about the Microsoft datacenter to which the drives
     * should be shipped.
     *
     * @param shippingInformation the shippingInformation value to set.
     * @return the JobDetails object itself.
     */
    public JobDetails withShippingInformation(ShippingInformation shippingInformation) {
        this.shippingInformation = shippingInformation;
        return this;
    }

    /**
     * Get the deliveryPackage property: Contains information about the package being shipped by the customer to the
     * Microsoft data center.
     *
     * @return the deliveryPackage value.
     */
    public DeliveryPackageInformation deliveryPackage() {
        return this.deliveryPackage;
    }

    /**
     * Set the deliveryPackage property: Contains information about the package being shipped by the customer to the
     * Microsoft data center.
     *
     * @param deliveryPackage the deliveryPackage value to set.
     * @return the JobDetails object itself.
     */
    public JobDetails withDeliveryPackage(DeliveryPackageInformation deliveryPackage) {
        this.deliveryPackage = deliveryPackage;
        return this;
    }

    /**
     * Get the returnPackage property: Contains information about the package being shipped from the Microsoft data
     * center to the customer to return the drives. The format is the same as the deliveryPackage property above. This
     * property is not included if the drives have not yet been returned.
     *
     * @return the returnPackage value.
     */
    public PackageInformation returnPackage() {
        return this.returnPackage;
    }

    /**
     * Set the returnPackage property: Contains information about the package being shipped from the Microsoft data
     * center to the customer to return the drives. The format is the same as the deliveryPackage property above. This
     * property is not included if the drives have not yet been returned.
     *
     * @param returnPackage the returnPackage value to set.
     * @return the JobDetails object itself.
     */
    public JobDetails withReturnPackage(PackageInformation returnPackage) {
        this.returnPackage = returnPackage;
        return this;
    }

    /**
     * Get the diagnosticsPath property: The virtual blob directory to which the copy logs and backups of drive manifest
     * files (if enabled) will be stored.
     *
     * @return the diagnosticsPath value.
     */
    public String diagnosticsPath() {
        return this.diagnosticsPath;
    }

    /**
     * Set the diagnosticsPath property: The virtual blob directory to which the copy logs and backups of drive manifest
     * files (if enabled) will be stored.
     *
     * @param diagnosticsPath the diagnosticsPath value to set.
     * @return the JobDetails object itself.
     */
    public JobDetails withDiagnosticsPath(String diagnosticsPath) {
        this.diagnosticsPath = diagnosticsPath;
        return this;
    }

    /**
     * Get the logLevel property: Default value is Error. Indicates whether error logging or verbose logging will be
     * enabled.
     *
     * @return the logLevel value.
     */
    public String logLevel() {
        return this.logLevel;
    }

    /**
     * Set the logLevel property: Default value is Error. Indicates whether error logging or verbose logging will be
     * enabled.
     *
     * @param logLevel the logLevel value to set.
     * @return the JobDetails object itself.
     */
    public JobDetails withLogLevel(String logLevel) {
        this.logLevel = logLevel;
        return this;
    }

    /**
     * Get the backupDriveManifest property: Default value is false. Indicates whether the manifest files on the drives
     * should be copied to block blobs.
     *
     * @return the backupDriveManifest value.
     */
    public Boolean backupDriveManifest() {
        return this.backupDriveManifest;
    }

    /**
     * Set the backupDriveManifest property: Default value is false. Indicates whether the manifest files on the drives
     * should be copied to block blobs.
     *
     * @param backupDriveManifest the backupDriveManifest value to set.
     * @return the JobDetails object itself.
     */
    public JobDetails withBackupDriveManifest(Boolean backupDriveManifest) {
        this.backupDriveManifest = backupDriveManifest;
        return this;
    }

    /**
     * Get the state property: Current state of the job.
     *
     * @return the state value.
     */
    public String state() {
        return this.state;
    }

    /**
     * Set the state property: Current state of the job.
     *
     * @param state the state value to set.
     * @return the JobDetails object itself.
     */
    public JobDetails withState(String state) {
        this.state = state;
        return this;
    }

    /**
     * Get the cancelRequested property: Indicates whether a request has been submitted to cancel the job.
     *
     * @return the cancelRequested value.
     */
    public Boolean cancelRequested() {
        return this.cancelRequested;
    }

    /**
     * Set the cancelRequested property: Indicates whether a request has been submitted to cancel the job.
     *
     * @param cancelRequested the cancelRequested value to set.
     * @return the JobDetails object itself.
     */
    public JobDetails withCancelRequested(Boolean cancelRequested) {
        this.cancelRequested = cancelRequested;
        return this;
    }

    /**
     * Get the percentComplete property: Overall percentage completed for the job.
     *
     * @return the percentComplete value.
     */
    public Long percentComplete() {
        return this.percentComplete;
    }

    /**
     * Set the percentComplete property: Overall percentage completed for the job.
     *
     * @param percentComplete the percentComplete value to set.
     * @return the JobDetails object itself.
     */
    public JobDetails withPercentComplete(Long percentComplete) {
        this.percentComplete = percentComplete;
        return this;
    }

    /**
     * Get the incompleteBlobListUri property: A blob path that points to a block blob containing a list of blob names
     * that were not exported due to insufficient drive space. If all blobs were exported successfully, then this
     * element is not included in the response.
     *
     * @return the incompleteBlobListUri value.
     */
    public String incompleteBlobListUri() {
        return this.incompleteBlobListUri;
    }

    /**
     * Set the incompleteBlobListUri property: A blob path that points to a block blob containing a list of blob names
     * that were not exported due to insufficient drive space. If all blobs were exported successfully, then this
     * element is not included in the response.
     *
     * @param incompleteBlobListUri the incompleteBlobListUri value to set.
     * @return the JobDetails object itself.
     */
    public JobDetails withIncompleteBlobListUri(String incompleteBlobListUri) {
        this.incompleteBlobListUri = incompleteBlobListUri;
        return this;
    }

    /**
     * Get the driveList property: List of up to ten drives that comprise the job. The drive list is a required element
     * for an import job; it is not specified for export jobs.
     *
     * @return the driveList value.
     */
    public List<DriveStatus> driveList() {
        return this.driveList;
    }

    /**
     * Set the driveList property: List of up to ten drives that comprise the job. The drive list is a required element
     * for an import job; it is not specified for export jobs.
     *
     * @param driveList the driveList value to set.
     * @return the JobDetails object itself.
     */
    public JobDetails withDriveList(List<DriveStatus> driveList) {
        this.driveList = driveList;
        return this;
    }

    /**
     * Get the export property: A property containing information about the blobs to be exported for an export job. This
     * property is included for export jobs only.
     *
     * @return the export value.
     */
    public Export export() {
        return this.export;
    }

    /**
     * Set the export property: A property containing information about the blobs to be exported for an export job. This
     * property is included for export jobs only.
     *
     * @param export the export value to set.
     * @return the JobDetails object itself.
     */
    public JobDetails withExport(Export export) {
        this.export = export;
        return this;
    }

    /**
     * Get the provisioningState property: Specifies the provisioning state of the job.
     *
     * @return the provisioningState value.
     */
    public String provisioningState() {
        return this.provisioningState;
    }

    /**
     * Set the provisioningState property: Specifies the provisioning state of the job.
     *
     * @param provisioningState the provisioningState value to set.
     * @return the JobDetails object itself.
     */
    public JobDetails withProvisioningState(String provisioningState) {
        this.provisioningState = provisioningState;
        return this;
    }

    /**
     * Get the encryptionKey property: Contains information about the encryption key.
     *
     * @return the encryptionKey value.
     */
    public EncryptionKeyDetails encryptionKey() {
        return this.encryptionKey;
    }

    /**
     * Set the encryptionKey property: Contains information about the encryption key.
     *
     * @param encryptionKey the encryptionKey value to set.
     * @return the JobDetails object itself.
     */
    public JobDetails withEncryptionKey(EncryptionKeyDetails encryptionKey) {
        this.encryptionKey = encryptionKey;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (returnAddress() != null) {
            returnAddress().validate();
        }
        if (returnShipping() != null) {
            returnShipping().validate();
        }
        if (shippingInformation() != null) {
            shippingInformation().validate();
        }
        if (deliveryPackage() != null) {
            deliveryPackage().validate();
        }
        if (returnPackage() != null) {
            returnPackage().validate();
        }
        if (driveList() != null) {
            driveList().forEach(e -> e.validate());
        }
        if (export() != null) {
            export().validate();
        }
        if (encryptionKey() != null) {
            encryptionKey().validate();
        }
    }
}
