// 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.Immutable;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import java.util.List;

/** The address validation output. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "validationType")
@JsonTypeName("ValidateAddress")
@Immutable
public final class AddressValidationProperties extends ValidationInputResponse {
    /*
     * The address validation status.
     */
    @JsonProperty(value = "validationStatus", access = JsonProperty.Access.WRITE_ONLY)
    private AddressValidationStatus validationStatus;

    /*
     * List of alternate addresses.
     */
    @JsonProperty(value = "alternateAddresses", access = JsonProperty.Access.WRITE_ONLY)
    private List<ShippingAddress> alternateAddresses;

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

    /**
     * Get the validationStatus property: The address validation status.
     *
     * @return the validationStatus value.
     */
    public AddressValidationStatus validationStatus() {
        return this.validationStatus;
    }

    /**
     * Get the alternateAddresses property: List of alternate addresses.
     *
     * @return the alternateAddresses value.
     */
    public List<ShippingAddress> alternateAddresses() {
        return this.alternateAddresses;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    @Override
    public void validate() {
        super.validate();
        if (alternateAddresses() != null) {
            alternateAddresses().forEach(e -> e.validate());
        }
    }
}
