// 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.fasterxml.jackson.annotation.JsonProperty;

/** Reverse Shipping Address and contact details for a job. */
@Fluent
public final class ReverseShippingDetails {
    /*
     * Contact Info.
     */
    @JsonProperty(value = "contactDetails")
    private ContactInfo contactDetails;

    /*
     * Shipping address where customer wishes to receive the device.
     */
    @JsonProperty(value = "shippingAddress")
    private ShippingAddress shippingAddress;

    /*
     * A flag to indicate whether Reverse Shipping details are updated or not after device has been prepared.
     * Read only field
     */
    @JsonProperty(value = "isUpdated", access = JsonProperty.Access.WRITE_ONLY)
    private Boolean isUpdated;

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

    /**
     * Get the contactDetails property: Contact Info.
     *
     * @return the contactDetails value.
     */
    public ContactInfo contactDetails() {
        return this.contactDetails;
    }

    /**
     * Set the contactDetails property: Contact Info.
     *
     * @param contactDetails the contactDetails value to set.
     * @return the ReverseShippingDetails object itself.
     */
    public ReverseShippingDetails withContactDetails(ContactInfo contactDetails) {
        this.contactDetails = contactDetails;
        return this;
    }

    /**
     * Get the shippingAddress property: Shipping address where customer wishes to receive the device.
     *
     * @return the shippingAddress value.
     */
    public ShippingAddress shippingAddress() {
        return this.shippingAddress;
    }

    /**
     * Set the shippingAddress property: Shipping address where customer wishes to receive the device.
     *
     * @param shippingAddress the shippingAddress value to set.
     * @return the ReverseShippingDetails object itself.
     */
    public ReverseShippingDetails withShippingAddress(ShippingAddress shippingAddress) {
        this.shippingAddress = shippingAddress;
        return this;
    }

    /**
     * Get the isUpdated property: A flag to indicate whether Reverse Shipping details are updated or not after device
     * has been prepared. Read only field.
     *
     * @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 (contactDetails() != null) {
            contactDetails().validate();
        }
        if (shippingAddress() != null) {
            shippingAddress().validate();
        }
    }
}
