// 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.AddressProperties;
import com.azure.resourcemanager.edgeorder.fluent.models.OrderItemUpdateProperties;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Map;

/** Updates order item parameters. */
@Fluent
public final class OrderItemUpdateParameter {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(OrderItemUpdateParameter.class);

    /*
     * Order item update properties
     */
    @JsonProperty(value = "properties")
    private OrderItemUpdateProperties 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: Order item update properties.
     *
     * @return the innerProperties value.
     */
    private OrderItemUpdateProperties 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 OrderItemUpdateParameter object itself.
     */
    public OrderItemUpdateParameter withTags(Map<String, String> tags) {
        this.tags = tags;
        return this;
    }

    /**
     * Get the forwardAddress property: Updates forward shipping address and contact details.
     *
     * @return the forwardAddress value.
     */
    public AddressProperties forwardAddress() {
        return this.innerProperties() == null ? null : this.innerProperties().forwardAddress();
    }

    /**
     * Set the forwardAddress property: Updates forward shipping address and contact details.
     *
     * @param forwardAddress the forwardAddress value to set.
     * @return the OrderItemUpdateParameter object itself.
     */
    public OrderItemUpdateParameter withForwardAddress(AddressProperties forwardAddress) {
        if (this.innerProperties() == null) {
            this.innerProperties = new OrderItemUpdateProperties();
        }
        this.innerProperties().withForwardAddress(forwardAddress);
        return this;
    }

    /**
     * Get the preferences property: Customer preference.
     *
     * @return the preferences value.
     */
    public Preferences preferences() {
        return this.innerProperties() == null ? null : this.innerProperties().preferences();
    }

    /**
     * Set the preferences property: Customer preference.
     *
     * @param preferences the preferences value to set.
     * @return the OrderItemUpdateParameter object itself.
     */
    public OrderItemUpdateParameter withPreferences(Preferences preferences) {
        if (this.innerProperties() == null) {
            this.innerProperties = new OrderItemUpdateProperties();
        }
        this.innerProperties().withPreferences(preferences);
        return this;
    }

    /**
     * Get the notificationEmailList property: Additional notification email list.
     *
     * @return the notificationEmailList value.
     */
    public List<String> notificationEmailList() {
        return this.innerProperties() == null ? null : this.innerProperties().notificationEmailList();
    }

    /**
     * Set the notificationEmailList property: Additional notification email list.
     *
     * @param notificationEmailList the notificationEmailList value to set.
     * @return the OrderItemUpdateParameter object itself.
     */
    public OrderItemUpdateParameter withNotificationEmailList(List<String> notificationEmailList) {
        if (this.innerProperties() == null) {
            this.innerProperties = new OrderItemUpdateProperties();
        }
        this.innerProperties().withNotificationEmailList(notificationEmailList);
        return this;
    }

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