// 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.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.storageimportexport.models.DeliveryPackageInformation;
import com.azure.resourcemanager.storageimportexport.models.DriveStatus;
import com.azure.resourcemanager.storageimportexport.models.ReturnAddress;
import com.azure.resourcemanager.storageimportexport.models.ReturnShipping;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Specifies the properties of a UpdateJob. */
@Fluent
public final class UpdateJobParametersProperties {
    /*
     * If specified, the value must be true. The service will attempt to cancel the job.
     */
    @JsonProperty(value = "cancelRequested")
    private Boolean cancelRequested;

    /*
     * If specified, the value must be Shipping, which tells the Import/Export service that the package for the job has
     * been shipped. The ReturnAddress and DeliveryPackage properties must have been set either in this request or in a
     * previous request, otherwise the request will fail.
     */
    @JsonProperty(value = "state")
    private String state;

    /*
     * 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 package being shipped by the customer to the Microsoft data center.
     */
    @JsonProperty(value = "deliveryPackage")
    private DeliveryPackageInformation deliveryPackage;

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

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

    /*
     * List of drives that comprise the job.
     */
    @JsonProperty(value = "driveList")
    private List<DriveStatus> driveList;

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

    /**
     * Get the cancelRequested property: If specified, the value must be true. The service will attempt to cancel the
     * job.
     *
     * @return the cancelRequested value.
     */
    public Boolean cancelRequested() {
        return this.cancelRequested;
    }

    /**
     * Set the cancelRequested property: If specified, the value must be true. The service will attempt to cancel the
     * job.
     *
     * @param cancelRequested the cancelRequested value to set.
     * @return the UpdateJobParametersProperties object itself.
     */
    public UpdateJobParametersProperties withCancelRequested(Boolean cancelRequested) {
        this.cancelRequested = cancelRequested;
        return this;
    }

    /**
     * Get the state property: If specified, the value must be Shipping, which tells the Import/Export service that the
     * package for the job has been shipped. The ReturnAddress and DeliveryPackage properties must have been set either
     * in this request or in a previous request, otherwise the request will fail.
     *
     * @return the state value.
     */
    public String state() {
        return this.state;
    }

    /**
     * Set the state property: If specified, the value must be Shipping, which tells the Import/Export service that the
     * package for the job has been shipped. The ReturnAddress and DeliveryPackage properties must have been set either
     * in this request or in a previous request, otherwise the request will fail.
     *
     * @param state the state value to set.
     * @return the UpdateJobParametersProperties object itself.
     */
    public UpdateJobParametersProperties withState(String state) {
        this.state = state;
        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 UpdateJobParametersProperties object itself.
     */
    public UpdateJobParametersProperties 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 UpdateJobParametersProperties object itself.
     */
    public UpdateJobParametersProperties withReturnShipping(ReturnShipping returnShipping) {
        this.returnShipping = returnShipping;
        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 UpdateJobParametersProperties object itself.
     */
    public UpdateJobParametersProperties withDeliveryPackage(DeliveryPackageInformation deliveryPackage) {
        this.deliveryPackage = deliveryPackage;
        return this;
    }

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

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

    /**
     * Get the backupDriveManifest property: 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: Indicates whether the manifest files on the drives should be copied to
     * block blobs.
     *
     * @param backupDriveManifest the backupDriveManifest value to set.
     * @return the UpdateJobParametersProperties object itself.
     */
    public UpdateJobParametersProperties withBackupDriveManifest(Boolean backupDriveManifest) {
        this.backupDriveManifest = backupDriveManifest;
        return this;
    }

    /**
     * Get the driveList property: List of drives that comprise the job.
     *
     * @return the driveList value.
     */
    public List<DriveStatus> driveList() {
        return this.driveList;
    }

    /**
     * Set the driveList property: List of drives that comprise the job.
     *
     * @param driveList the driveList value to set.
     * @return the UpdateJobParametersProperties object itself.
     */
    public UpdateJobParametersProperties withDriveList(List<DriveStatus> driveList) {
        this.driveList = driveList;
        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 (deliveryPackage() != null) {
            deliveryPackage().validate();
        }
        if (driveList() != null) {
            driveList().forEach(e -> e.validate());
        }
    }
}
