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

package com.azure.resourcemanager.videoanalyzer.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
import com.azure.resourcemanager.videoanalyzer.models.AccountEncryption;
import com.azure.resourcemanager.videoanalyzer.models.Endpoint;
import com.azure.resourcemanager.videoanalyzer.models.IotHub;
import com.azure.resourcemanager.videoanalyzer.models.NetworkAccessControl;
import com.azure.resourcemanager.videoanalyzer.models.ProvisioningState;
import com.azure.resourcemanager.videoanalyzer.models.PublicNetworkAccess;
import com.azure.resourcemanager.videoanalyzer.models.StorageAccount;
import com.azure.resourcemanager.videoanalyzer.models.VideoAnalyzerIdentity;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Map;

/** The Video Analyzer account. */
@Fluent
public final class VideoAnalyzerInner extends Resource {
    /*
     * The resource properties.
     */
    @JsonProperty(value = "properties")
    private VideoAnalyzerProperties innerProperties;

    /*
     * The identities associated to the Video Analyzer resource.
     */
    @JsonProperty(value = "identity")
    private VideoAnalyzerIdentity identity;

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

    /**
     * Get the identity property: The identities associated to the Video Analyzer resource.
     *
     * @return the identity value.
     */
    public VideoAnalyzerIdentity identity() {
        return this.identity;
    }

    /**
     * Set the identity property: The identities associated to the Video Analyzer resource.
     *
     * @param identity the identity value to set.
     * @return the VideoAnalyzerInner object itself.
     */
    public VideoAnalyzerInner withIdentity(VideoAnalyzerIdentity identity) {
        this.identity = identity;
        return this;
    }

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

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

    /**
     * Get the storageAccounts property: The storage accounts for this resource.
     *
     * @return the storageAccounts value.
     */
    public List<StorageAccount> storageAccounts() {
        return this.innerProperties() == null ? null : this.innerProperties().storageAccounts();
    }

    /**
     * Set the storageAccounts property: The storage accounts for this resource.
     *
     * @param storageAccounts the storageAccounts value to set.
     * @return the VideoAnalyzerInner object itself.
     */
    public VideoAnalyzerInner withStorageAccounts(List<StorageAccount> storageAccounts) {
        if (this.innerProperties() == null) {
            this.innerProperties = new VideoAnalyzerProperties();
        }
        this.innerProperties().withStorageAccounts(storageAccounts);
        return this;
    }

    /**
     * Get the endpoints property: The endpoints associated with this resource.
     *
     * @return the endpoints value.
     */
    public List<Endpoint> endpoints() {
        return this.innerProperties() == null ? null : this.innerProperties().endpoints();
    }

    /**
     * Get the encryption property: The account encryption properties.
     *
     * @return the encryption value.
     */
    public AccountEncryption encryption() {
        return this.innerProperties() == null ? null : this.innerProperties().encryption();
    }

    /**
     * Set the encryption property: The account encryption properties.
     *
     * @param encryption the encryption value to set.
     * @return the VideoAnalyzerInner object itself.
     */
    public VideoAnalyzerInner withEncryption(AccountEncryption encryption) {
        if (this.innerProperties() == null) {
            this.innerProperties = new VideoAnalyzerProperties();
        }
        this.innerProperties().withEncryption(encryption);
        return this;
    }

    /**
     * Get the iotHubs property: The IoT Hubs for this resource.
     *
     * @return the iotHubs value.
     */
    public List<IotHub> iotHubs() {
        return this.innerProperties() == null ? null : this.innerProperties().iotHubs();
    }

    /**
     * Set the iotHubs property: The IoT Hubs for this resource.
     *
     * @param iotHubs the iotHubs value to set.
     * @return the VideoAnalyzerInner object itself.
     */
    public VideoAnalyzerInner withIotHubs(List<IotHub> iotHubs) {
        if (this.innerProperties() == null) {
            this.innerProperties = new VideoAnalyzerProperties();
        }
        this.innerProperties().withIotHubs(iotHubs);
        return this;
    }

    /**
     * Get the publicNetworkAccess property: Whether or not public network access is allowed for resources under the
     * Video Analyzer account.
     *
     * @return the publicNetworkAccess value.
     */
    public PublicNetworkAccess publicNetworkAccess() {
        return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccess();
    }

    /**
     * Set the publicNetworkAccess property: Whether or not public network access is allowed for resources under the
     * Video Analyzer account.
     *
     * @param publicNetworkAccess the publicNetworkAccess value to set.
     * @return the VideoAnalyzerInner object itself.
     */
    public VideoAnalyzerInner withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) {
        if (this.innerProperties() == null) {
            this.innerProperties = new VideoAnalyzerProperties();
        }
        this.innerProperties().withPublicNetworkAccess(publicNetworkAccess);
        return this;
    }

    /**
     * Get the networkAccessControl property: Network access control for Video Analyzer.
     *
     * @return the networkAccessControl value.
     */
    public NetworkAccessControl networkAccessControl() {
        return this.innerProperties() == null ? null : this.innerProperties().networkAccessControl();
    }

    /**
     * Set the networkAccessControl property: Network access control for Video Analyzer.
     *
     * @param networkAccessControl the networkAccessControl value to set.
     * @return the VideoAnalyzerInner object itself.
     */
    public VideoAnalyzerInner withNetworkAccessControl(NetworkAccessControl networkAccessControl) {
        if (this.innerProperties() == null) {
            this.innerProperties = new VideoAnalyzerProperties();
        }
        this.innerProperties().withNetworkAccessControl(networkAccessControl);
        return this;
    }

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

    /**
     * Get the privateEndpointConnections property: Private Endpoint Connections created under Video Analyzer account.
     *
     * @return the privateEndpointConnections value.
     */
    public List<PrivateEndpointConnectionInner> privateEndpointConnections() {
        return this.innerProperties() == null ? null : this.innerProperties().privateEndpointConnections();
    }

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