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

package com.azure.resourcemanager.communication.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.communication.fluent.models.CommunicationServiceUpdateProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Map;

/** A class representing update parameters for CommunicationService resource. */
@Fluent
public final class CommunicationServiceResourceUpdate extends TaggedResource {
    /*
     * The properties of the service.
     */
    @JsonProperty(value = "properties")
    private CommunicationServiceUpdateProperties innerProperties;

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

    /**
     * Get the innerProperties property: The properties of the service.
     *
     * @return the innerProperties value.
     */
    private CommunicationServiceUpdateProperties innerProperties() {
        return this.innerProperties;
    }

    /** {@inheritDoc} */
    @Override
    public CommunicationServiceResourceUpdate withTags(Map<String, String> tags) {
        super.withTags(tags);
        return this;
    }

    /**
     * Get the linkedDomains property: List of email Domain resource Ids.
     *
     * @return the linkedDomains value.
     */
    public List<String> linkedDomains() {
        return this.innerProperties() == null ? null : this.innerProperties().linkedDomains();
    }

    /**
     * Set the linkedDomains property: List of email Domain resource Ids.
     *
     * @param linkedDomains the linkedDomains value to set.
     * @return the CommunicationServiceResourceUpdate object itself.
     */
    public CommunicationServiceResourceUpdate withLinkedDomains(List<String> linkedDomains) {
        if (this.innerProperties() == null) {
            this.innerProperties = new CommunicationServiceUpdateProperties();
        }
        this.innerProperties().withLinkedDomains(linkedDomains);
        return this;
    }

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