// 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;

/** Preferences related to the shipment logistics of the sku. */
@Fluent
public final class TransportPreferences {
    /*
     * Indicates Shipment Logistics type that the customer preferred.
     */
    @JsonProperty(value = "preferredShipmentType", required = true)
    private TransportShipmentTypes preferredShipmentType;

    /*
     * Read only property which indicates whether transport preferences has been updated or not after device is
     * prepared.
     */
    @JsonProperty(value = "isUpdated", access = JsonProperty.Access.WRITE_ONLY)
    private Boolean isUpdated;

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

    /**
     * Get the preferredShipmentType property: Indicates Shipment Logistics type that the customer preferred.
     *
     * @return the preferredShipmentType value.
     */
    public TransportShipmentTypes preferredShipmentType() {
        return this.preferredShipmentType;
    }

    /**
     * Set the preferredShipmentType property: Indicates Shipment Logistics type that the customer preferred.
     *
     * @param preferredShipmentType the preferredShipmentType value to set.
     * @return the TransportPreferences object itself.
     */
    public TransportPreferences withPreferredShipmentType(TransportShipmentTypes preferredShipmentType) {
        this.preferredShipmentType = preferredShipmentType;
        return this;
    }

    /**
     * Get the isUpdated property: Read only property which indicates whether transport preferences has been updated or
     * not after device is prepared.
     *
     * @return the isUpdated value.
     */
    public Boolean isUpdated() {
        return this.isUpdated;
    }

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

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