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

import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
import com.azure.core.management.SystemData;
import com.azure.resourcemanager.managednetworkfabric.models.CommunityActionTypes;
import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Map;

/** The IpExtendedCommunity resource definition. */
@Fluent
public final class IpExtendedCommunityInner extends Resource {
    /*
     * Resource properties.
     */
    @JsonProperty(value = "properties")
    private IpExtendedCommunityProperties innerProperties;

    /*
     * Azure Resource Manager metadata containing createdBy and modifiedBy information.
     */
    @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
    private SystemData systemData;

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

    /**
     * Get the innerProperties property: Resource properties.
     *
     * @return the innerProperties value.
     */
    private IpExtendedCommunityProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
     *
     * @return the systemData value.
     */
    public SystemData systemData() {
        return this.systemData;
    }

    /** {@inheritDoc} */
    @Override
    public IpExtendedCommunityInner withLocation(String location) {
        super.withLocation(location);
        return this;
    }

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

    /**
     * Get the action property: Action to be taken on the configuration. Example: Permit | Deny.
     *
     * @return the action value.
     */
    public CommunityActionTypes action() {
        return this.innerProperties() == null ? null : this.innerProperties().action();
    }

    /**
     * Set the action property: Action to be taken on the configuration. Example: Permit | Deny.
     *
     * @param action the action value to set.
     * @return the IpExtendedCommunityInner object itself.
     */
    public IpExtendedCommunityInner withAction(CommunityActionTypes action) {
        if (this.innerProperties() == null) {
            this.innerProperties = new IpExtendedCommunityProperties();
        }
        this.innerProperties().withAction(action);
        return this;
    }

    /**
     * Get the routeTargets property: Route Target List.The expected formats are ASN(plain):NN &gt;&gt; example
     * 4294967294:50, ASN.ASN:NN &gt;&gt; example 65533.65333:40, IP-address:NN &gt;&gt; example 10.10.10.10:65535. The
     * possible values of ASN,NN are in range of 0-65535, ASN(plain) is in range of 0-4294967295.
     *
     * @return the routeTargets value.
     */
    public List<String> routeTargets() {
        return this.innerProperties() == null ? null : this.innerProperties().routeTargets();
    }

    /**
     * Set the routeTargets property: Route Target List.The expected formats are ASN(plain):NN &gt;&gt; example
     * 4294967294:50, ASN.ASN:NN &gt;&gt; example 65533.65333:40, IP-address:NN &gt;&gt; example 10.10.10.10:65535. The
     * possible values of ASN,NN are in range of 0-65535, ASN(plain) is in range of 0-4294967295.
     *
     * @param routeTargets the routeTargets value to set.
     * @return the IpExtendedCommunityInner object itself.
     */
    public IpExtendedCommunityInner withRouteTargets(List<String> routeTargets) {
        if (this.innerProperties() == null) {
            this.innerProperties = new IpExtendedCommunityProperties();
        }
        this.innerProperties().withRouteTargets(routeTargets);
        return this;
    }

    /**
     * Get the provisioningState property: Gets the provisioning state of the resource.
     *
     * @return the provisioningState value.
     */
    public ProvisioningState provisioningState() {
        return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
    }

    /**
     * Get the annotation property: Switch configuration description.
     *
     * @return the annotation value.
     */
    public String annotation() {
        return this.innerProperties() == null ? null : this.innerProperties().annotation();
    }

    /**
     * Set the annotation property: Switch configuration description.
     *
     * @param annotation the annotation value to set.
     * @return the IpExtendedCommunityInner object itself.
     */
    public IpExtendedCommunityInner withAnnotation(String annotation) {
        if (this.innerProperties() == null) {
            this.innerProperties = new IpExtendedCommunityProperties();
        }
        this.innerProperties().withAnnotation(annotation);
        return this;
    }

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