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

package com.azure.resourcemanager.managednetworkfabric.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;

/** IP Extended Community Properties. */
@Fluent
public final class ActionIpExtendedCommunityProperties extends IpExtendedCommunityAddOperationProperties {
    /*
     * IP Extended Community Id list properties.
     */
    @JsonProperty(value = "delete")
    private IpExtendedCommunityIdList delete;

    /*
     * IP Extended Community Id list properties.
     */
    @JsonProperty(value = "set")
    private IpExtendedCommunityIdList set;

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

    /**
     * Get the delete property: IP Extended Community Id list properties.
     *
     * @return the delete value.
     */
    public IpExtendedCommunityIdList delete() {
        return this.delete;
    }

    /**
     * Set the delete property: IP Extended Community Id list properties.
     *
     * @param delete the delete value to set.
     * @return the ActionIpExtendedCommunityProperties object itself.
     */
    public ActionIpExtendedCommunityProperties withDelete(IpExtendedCommunityIdList delete) {
        this.delete = delete;
        return this;
    }

    /**
     * Get the set property: IP Extended Community Id list properties.
     *
     * @return the set value.
     */
    public IpExtendedCommunityIdList set() {
        return this.set;
    }

    /**
     * Set the set property: IP Extended Community Id list properties.
     *
     * @param set the set value to set.
     * @return the ActionIpExtendedCommunityProperties object itself.
     */
    public ActionIpExtendedCommunityProperties withSet(IpExtendedCommunityIdList set) {
        this.set = set;
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public ActionIpExtendedCommunityProperties withAdd(IpExtendedCommunityIdList add) {
        super.withAdd(add);
        return this;
    }

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