// 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.core.util.logging.ClientLogger;
import com.azure.resourcemanager.managednetworkfabric.models.AccessControlListMatchConfiguration;
import com.azure.resourcemanager.managednetworkfabric.models.AdministrativeState;
import com.azure.resourcemanager.managednetworkfabric.models.CommonDynamicMatchConfiguration;
import com.azure.resourcemanager.managednetworkfabric.models.ConfigurationState;
import com.azure.resourcemanager.managednetworkfabric.models.ConfigurationType;
import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;
import java.util.List;
import java.util.Map;

/** The Access Control List resource definition. */
@Fluent
public final class AccessControlListInner extends Resource {
    /*
     * Resource properties.
     */
    @JsonProperty(value = "properties", required = true)
    private AccessControlListProperties innerProperties = new AccessControlListProperties();

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

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

    /**
     * Get the innerProperties property: Resource properties.
     *
     * @return the innerProperties value.
     */
    private AccessControlListProperties 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 AccessControlListInner withLocation(String location) {
        super.withLocation(location);
        return this;
    }

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

    /**
     * Get the lastSyncedTime property: The last synced timestamp.
     *
     * @return the lastSyncedTime value.
     */
    public OffsetDateTime lastSyncedTime() {
        return this.innerProperties() == null ? null : this.innerProperties().lastSyncedTime();
    }

    /**
     * Get the configurationState property: Configuration state of the resource.
     *
     * @return the configurationState value.
     */
    public ConfigurationState configurationState() {
        return this.innerProperties() == null ? null : this.innerProperties().configurationState();
    }

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

    /**
     * Get the administrativeState property: Administrative state of the resource.
     *
     * @return the administrativeState value.
     */
    public AdministrativeState administrativeState() {
        return this.innerProperties() == null ? null : this.innerProperties().administrativeState();
    }

    /**
     * Get the configurationType property: Input method to configure Access Control List.
     *
     * @return the configurationType value.
     */
    public ConfigurationType configurationType() {
        return this.innerProperties() == null ? null : this.innerProperties().configurationType();
    }

    /**
     * Set the configurationType property: Input method to configure Access Control List.
     *
     * @param configurationType the configurationType value to set.
     * @return the AccessControlListInner object itself.
     */
    public AccessControlListInner withConfigurationType(ConfigurationType configurationType) {
        if (this.innerProperties() == null) {
            this.innerProperties = new AccessControlListProperties();
        }
        this.innerProperties().withConfigurationType(configurationType);
        return this;
    }

    /**
     * Get the aclsUrl property: Access Control List file URL.
     *
     * @return the aclsUrl value.
     */
    public String aclsUrl() {
        return this.innerProperties() == null ? null : this.innerProperties().aclsUrl();
    }

    /**
     * Set the aclsUrl property: Access Control List file URL.
     *
     * @param aclsUrl the aclsUrl value to set.
     * @return the AccessControlListInner object itself.
     */
    public AccessControlListInner withAclsUrl(String aclsUrl) {
        if (this.innerProperties() == null) {
            this.innerProperties = new AccessControlListProperties();
        }
        this.innerProperties().withAclsUrl(aclsUrl);
        return this;
    }

    /**
     * Get the matchConfigurations property: List of match configurations.
     *
     * @return the matchConfigurations value.
     */
    public List<AccessControlListMatchConfiguration> matchConfigurations() {
        return this.innerProperties() == null ? null : this.innerProperties().matchConfigurations();
    }

    /**
     * Set the matchConfigurations property: List of match configurations.
     *
     * @param matchConfigurations the matchConfigurations value to set.
     * @return the AccessControlListInner object itself.
     */
    public AccessControlListInner withMatchConfigurations(
        List<AccessControlListMatchConfiguration> matchConfigurations) {
        if (this.innerProperties() == null) {
            this.innerProperties = new AccessControlListProperties();
        }
        this.innerProperties().withMatchConfigurations(matchConfigurations);
        return this;
    }

    /**
     * Get the dynamicMatchConfigurations property: List of dynamic match configurations.
     *
     * @return the dynamicMatchConfigurations value.
     */
    public List<CommonDynamicMatchConfiguration> dynamicMatchConfigurations() {
        return this.innerProperties() == null ? null : this.innerProperties().dynamicMatchConfigurations();
    }

    /**
     * Set the dynamicMatchConfigurations property: List of dynamic match configurations.
     *
     * @param dynamicMatchConfigurations the dynamicMatchConfigurations value to set.
     * @return the AccessControlListInner object itself.
     */
    public AccessControlListInner withDynamicMatchConfigurations(
        List<CommonDynamicMatchConfiguration> dynamicMatchConfigurations) {
        if (this.innerProperties() == null) {
            this.innerProperties = new AccessControlListProperties();
        }
        this.innerProperties().withDynamicMatchConfigurations(dynamicMatchConfigurations);
        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 AccessControlListInner object itself.
     */
    public AccessControlListInner withAnnotation(String annotation) {
        if (this.innerProperties() == null) {
            this.innerProperties = new AccessControlListProperties();
        }
        this.innerProperties().withAnnotation(annotation);
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (innerProperties() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property innerProperties in model AccessControlListInner"));
        } else {
            innerProperties().validate();
        }
    }

    private static final ClientLogger LOGGER = new ClientLogger(AccessControlListInner.class);
}
