// 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.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Contains information about the package being shipped by the customer to the Microsoft data center. */
@Fluent
public final class PackageInformation {
    /*
     * The name of the carrier that is used to ship the import or export drives.
     */
    @JsonProperty(value = "carrierName", required = true)
    private String carrierName;

    /*
     * The tracking number of the package.
     */
    @JsonProperty(value = "trackingNumber", required = true)
    private String trackingNumber;

    /*
     * The number of drives included in the package.
     */
    @JsonProperty(value = "driveCount", required = true)
    private long driveCount;

    /*
     * The date when the package is shipped.
     */
    @JsonProperty(value = "shipDate", required = true)
    private String shipDate;

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

    /**
     * Get the carrierName property: The name of the carrier that is used to ship the import or export drives.
     *
     * @return the carrierName value.
     */
    public String carrierName() {
        return this.carrierName;
    }

    /**
     * Set the carrierName property: The name of the carrier that is used to ship the import or export drives.
     *
     * @param carrierName the carrierName value to set.
     * @return the PackageInformation object itself.
     */
    public PackageInformation withCarrierName(String carrierName) {
        this.carrierName = carrierName;
        return this;
    }

    /**
     * Get the trackingNumber property: The tracking number of the package.
     *
     * @return the trackingNumber value.
     */
    public String trackingNumber() {
        return this.trackingNumber;
    }

    /**
     * Set the trackingNumber property: The tracking number of the package.
     *
     * @param trackingNumber the trackingNumber value to set.
     * @return the PackageInformation object itself.
     */
    public PackageInformation withTrackingNumber(String trackingNumber) {
        this.trackingNumber = trackingNumber;
        return this;
    }

    /**
     * Get the driveCount property: The number of drives included in the package.
     *
     * @return the driveCount value.
     */
    public long driveCount() {
        return this.driveCount;
    }

    /**
     * Set the driveCount property: The number of drives included in the package.
     *
     * @param driveCount the driveCount value to set.
     * @return the PackageInformation object itself.
     */
    public PackageInformation withDriveCount(long driveCount) {
        this.driveCount = driveCount;
        return this;
    }

    /**
     * Get the shipDate property: The date when the package is shipped.
     *
     * @return the shipDate value.
     */
    public String shipDate() {
        return this.shipDate;
    }

    /**
     * Set the shipDate property: The date when the package is shipped.
     *
     * @param shipDate the shipDate value to set.
     * @return the PackageInformation object itself.
     */
    public PackageInformation withShipDate(String shipDate) {
        this.shipDate = shipDate;
        return this;
    }

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

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