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

/** Specifies the return address information for the job. */
@Fluent
public final class ReturnAddress {
    /*
     * The name of the recipient who will receive the hard drives when they are returned.
     */
    @JsonProperty(value = "recipientName", required = true)
    private String recipientName;

    /*
     * The first line of the street address to use when returning the drives.
     */
    @JsonProperty(value = "streetAddress1", required = true)
    private String streetAddress1;

    /*
     * The second line of the street address to use when returning the drives.
     */
    @JsonProperty(value = "streetAddress2")
    private String streetAddress2;

    /*
     * The city name to use when returning the drives.
     */
    @JsonProperty(value = "city", required = true)
    private String city;

    /*
     * The state or province to use when returning the drives.
     */
    @JsonProperty(value = "stateOrProvince")
    private String stateOrProvince;

    /*
     * The postal code to use when returning the drives.
     */
    @JsonProperty(value = "postalCode", required = true)
    private String postalCode;

    /*
     * The country or region to use when returning the drives.
     */
    @JsonProperty(value = "countryOrRegion", required = true)
    private String countryOrRegion;

    /*
     * Phone number of the recipient of the returned drives.
     */
    @JsonProperty(value = "phone", required = true)
    private String phone;

    /*
     * Email address of the recipient of the returned drives.
     */
    @JsonProperty(value = "email", required = true)
    private String email;

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

    /**
     * Get the recipientName property: The name of the recipient who will receive the hard drives when they are
     * returned.
     *
     * @return the recipientName value.
     */
    public String recipientName() {
        return this.recipientName;
    }

    /**
     * Set the recipientName property: The name of the recipient who will receive the hard drives when they are
     * returned.
     *
     * @param recipientName the recipientName value to set.
     * @return the ReturnAddress object itself.
     */
    public ReturnAddress withRecipientName(String recipientName) {
        this.recipientName = recipientName;
        return this;
    }

    /**
     * Get the streetAddress1 property: The first line of the street address to use when returning the drives.
     *
     * @return the streetAddress1 value.
     */
    public String streetAddress1() {
        return this.streetAddress1;
    }

    /**
     * Set the streetAddress1 property: The first line of the street address to use when returning the drives.
     *
     * @param streetAddress1 the streetAddress1 value to set.
     * @return the ReturnAddress object itself.
     */
    public ReturnAddress withStreetAddress1(String streetAddress1) {
        this.streetAddress1 = streetAddress1;
        return this;
    }

    /**
     * Get the streetAddress2 property: The second line of the street address to use when returning the drives.
     *
     * @return the streetAddress2 value.
     */
    public String streetAddress2() {
        return this.streetAddress2;
    }

    /**
     * Set the streetAddress2 property: The second line of the street address to use when returning the drives.
     *
     * @param streetAddress2 the streetAddress2 value to set.
     * @return the ReturnAddress object itself.
     */
    public ReturnAddress withStreetAddress2(String streetAddress2) {
        this.streetAddress2 = streetAddress2;
        return this;
    }

    /**
     * Get the city property: The city name to use when returning the drives.
     *
     * @return the city value.
     */
    public String city() {
        return this.city;
    }

    /**
     * Set the city property: The city name to use when returning the drives.
     *
     * @param city the city value to set.
     * @return the ReturnAddress object itself.
     */
    public ReturnAddress withCity(String city) {
        this.city = city;
        return this;
    }

    /**
     * Get the stateOrProvince property: The state or province to use when returning the drives.
     *
     * @return the stateOrProvince value.
     */
    public String stateOrProvince() {
        return this.stateOrProvince;
    }

    /**
     * Set the stateOrProvince property: The state or province to use when returning the drives.
     *
     * @param stateOrProvince the stateOrProvince value to set.
     * @return the ReturnAddress object itself.
     */
    public ReturnAddress withStateOrProvince(String stateOrProvince) {
        this.stateOrProvince = stateOrProvince;
        return this;
    }

    /**
     * Get the postalCode property: The postal code to use when returning the drives.
     *
     * @return the postalCode value.
     */
    public String postalCode() {
        return this.postalCode;
    }

    /**
     * Set the postalCode property: The postal code to use when returning the drives.
     *
     * @param postalCode the postalCode value to set.
     * @return the ReturnAddress object itself.
     */
    public ReturnAddress withPostalCode(String postalCode) {
        this.postalCode = postalCode;
        return this;
    }

    /**
     * Get the countryOrRegion property: The country or region to use when returning the drives.
     *
     * @return the countryOrRegion value.
     */
    public String countryOrRegion() {
        return this.countryOrRegion;
    }

    /**
     * Set the countryOrRegion property: The country or region to use when returning the drives.
     *
     * @param countryOrRegion the countryOrRegion value to set.
     * @return the ReturnAddress object itself.
     */
    public ReturnAddress withCountryOrRegion(String countryOrRegion) {
        this.countryOrRegion = countryOrRegion;
        return this;
    }

    /**
     * Get the phone property: Phone number of the recipient of the returned drives.
     *
     * @return the phone value.
     */
    public String phone() {
        return this.phone;
    }

    /**
     * Set the phone property: Phone number of the recipient of the returned drives.
     *
     * @param phone the phone value to set.
     * @return the ReturnAddress object itself.
     */
    public ReturnAddress withPhone(String phone) {
        this.phone = phone;
        return this;
    }

    /**
     * Get the email property: Email address of the recipient of the returned drives.
     *
     * @return the email value.
     */
    public String email() {
        return this.email;
    }

    /**
     * Set the email property: Email address of the recipient of the returned drives.
     *
     * @param email the email value to set.
     * @return the ReturnAddress object itself.
     */
    public ReturnAddress withEmail(String email) {
        this.email = email;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (recipientName() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException("Missing required property recipientName in model ReturnAddress"));
        }
        if (streetAddress1() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException("Missing required property streetAddress1 in model ReturnAddress"));
        }
        if (city() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException("Missing required property city in model ReturnAddress"));
        }
        if (postalCode() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException("Missing required property postalCode in model ReturnAddress"));
        }
        if (countryOrRegion() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException("Missing required property countryOrRegion in model ReturnAddress"));
        }
        if (phone() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException("Missing required property phone in model ReturnAddress"));
        }
        if (email() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException("Missing required property email in model ReturnAddress"));
        }
    }

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