// 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.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.edgeorder.models.Preferences;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Order item update properties. */
@Fluent
public final class OrderItemUpdateProperties {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(OrderItemUpdateProperties.class);

    /*
     * Updates forward shipping address and contact details.
     */
    @JsonProperty(value = "forwardAddress")
    private AddressProperties forwardAddress;

    /*
     * Customer preference.
     */
    @JsonProperty(value = "preferences")
    private Preferences preferences;

    /*
     * Additional notification email list.
     */
    @JsonProperty(value = "notificationEmailList")
    private List<String> notificationEmailList;

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

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

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

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

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

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

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