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

/** The AccessControlList patch resource definition. */
@Fluent
public final class AccessControlListPatch {
    /*
     * Resource properties.
     */
    @JsonProperty(value = "properties")
    private AccessControlListPatchProperties innerProperties;

    /*
     * Resource tags
     */
    @JsonProperty(value = "tags")
    @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
    private Map<String, String> tags;

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

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

    /**
     * Get the tags property: Resource tags.
     *
     * @return the tags value.
     */
    public Map<String, String> tags() {
        return this.tags;
    }

    /**
     * Set the tags property: Resource tags.
     *
     * @param tags the tags value to set.
     * @return the AccessControlListPatch object itself.
     */
    public AccessControlListPatch withTags(Map<String, String> tags) {
        this.tags = tags;
        return this;
    }

    /**
     * Get the addressFamily property: IP address family. Example: ipv4 | ipv6.
     *
     * @return the addressFamily value.
     */
    public AddressFamily addressFamily() {
        return this.innerProperties() == null ? null : this.innerProperties().addressFamily();
    }

    /**
     * Set the addressFamily property: IP address family. Example: ipv4 | ipv6.
     *
     * @param addressFamily the addressFamily value to set.
     * @return the AccessControlListPatch object itself.
     */
    public AccessControlListPatch withAddressFamily(AddressFamily addressFamily) {
        if (this.innerProperties() == null) {
            this.innerProperties = new AccessControlListPatchProperties();
        }
        this.innerProperties().withAddressFamily(addressFamily);
        return this;
    }

    /**
     * Get the conditions property: Access Control List conditions.
     *
     * @return the conditions value.
     */
    public List<AccessControlListConditionProperties> conditions() {
        return this.innerProperties() == null ? null : this.innerProperties().conditions();
    }

    /**
     * Set the conditions property: Access Control List conditions.
     *
     * @param conditions the conditions value to set.
     * @return the AccessControlListPatch object itself.
     */
    public AccessControlListPatch withConditions(List<AccessControlListConditionProperties> conditions) {
        if (this.innerProperties() == null) {
            this.innerProperties = new AccessControlListPatchProperties();
        }
        this.innerProperties().withConditions(conditions);
        return this;
    }

    /**
     * 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 AccessControlListPatch object itself.
     */
    public AccessControlListPatch withAnnotation(String annotation) {
        if (this.innerProperties() == null) {
            this.innerProperties = new AccessControlListPatchProperties();
        }
        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();
        }
    }
}
