// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.edgeorder.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.edgeorder.fluent.models.AddressUpdateProperties;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/** The Address update parameters. */
@Fluent
public final class AddressUpdateParameter {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(AddressUpdateParameter.class);

    /*
     * Properties of a address to be updated.
     */
    @JsonProperty(value = "properties")
    private AddressUpdateProperties innerProperties;

    /*
     * The list of key value pairs that describe the resource. These tags can
     * be used in viewing and grouping this resource (across resource groups).
     */
    @JsonProperty(value = "tags")
    @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
    private Map<String, String> tags;

    /**
     * Get the innerProperties property: Properties of a address to be updated.
     *
     * @return the innerProperties value.
     */
    private AddressUpdateProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the tags property: The list of key value pairs that describe the resource. These tags can be used in viewing
     * and grouping this resource (across resource groups).
     *
     * @return the tags value.
     */
    public Map<String, String> tags() {
        return this.tags;
    }

    /**
     * Set the tags property: The list of key value pairs that describe the resource. These tags can be used in viewing
     * and grouping this resource (across resource groups).
     *
     * @param tags the tags value to set.
     * @return the AddressUpdateParameter object itself.
     */
    public AddressUpdateParameter withTags(Map<String, String> tags) {
        this.tags = tags;
        return this;
    }

    /**
     * Get the shippingAddress property: Shipping details for the address.
     *
     * @return the shippingAddress value.
     */
    public ShippingAddress shippingAddress() {
        return this.innerProperties() == null ? null : this.innerProperties().shippingAddress();
    }

    /**
     * Set the shippingAddress property: Shipping details for the address.
     *
     * @param shippingAddress the shippingAddress value to set.
     * @return the AddressUpdateParameter object itself.
     */
    public AddressUpdateParameter withShippingAddress(ShippingAddress shippingAddress) {
        if (this.innerProperties() == null) {
            this.innerProperties = new AddressUpdateProperties();
        }
        this.innerProperties().withShippingAddress(shippingAddress);
        return this;
    }

    /**
     * Get the contactDetails property: Contact details for the address.
     *
     * @return the contactDetails value.
     */
    public ContactDetails contactDetails() {
        return this.innerProperties() == null ? null : this.innerProperties().contactDetails();
    }

    /**
     * Set the contactDetails property: Contact details for the address.
     *
     * @param contactDetails the contactDetails value to set.
     * @return the AddressUpdateParameter object itself.
     */
    public AddressUpdateParameter withContactDetails(ContactDetails contactDetails) {
        if (this.innerProperties() == null) {
            this.innerProperties = new AddressUpdateProperties();
        }
        this.innerProperties().withContactDetails(contactDetails);
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (innerProperties() != null) {
            innerProperties().validate();
        }
    }
}
