// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

// <auto-generated/>

#nullable disable

using System;
using Azure.Core;
using Azure.Core.Pipeline;
using Azure.Graph.Rbac;

namespace Azure.Graph.Rbac
{
    /// <summary> Rbac service management client. </summary>
    public partial class RbacManagementClient
    {
        private readonly ClientDiagnostics _clientDiagnostics;
        private readonly HttpPipeline _pipeline;
        private readonly string _tenantID;
        private readonly Uri _endpoint;

        /// <summary> Initializes a new instance of RbacManagementClient for mocking. </summary>
        protected RbacManagementClient()
        {
        }

        /// <summary> Initializes a new instance of RbacManagementClient. </summary>
        /// <param name="tenantID"> The tenant ID. </param>
        /// <param name="tokenCredential"> The OAuth token for making client requests. </param>
        /// <param name="options"> The options for configuring the client. </param>
        public RbacManagementClient(string tenantID, TokenCredential tokenCredential, RbacManagementClientOptions options = null) : this(tenantID, null, tokenCredential, options)
        {
        }
        /// <summary> Initializes a new instance of RbacManagementClient. </summary>
        /// <param name="tenantID"> The tenant ID. </param>
        /// <param name="endpoint"> server parameter. </param>
        /// <param name="tokenCredential"> The OAuth token for making client requests. </param>
        /// <param name="options"> The options for configuring the client. </param>
        /// <exception cref="ArgumentNullException"> <paramref name="tenantID"/> is null. </exception>
        public RbacManagementClient(string tenantID, Uri endpoint, TokenCredential tokenCredential, RbacManagementClientOptions options = null)
        {
            if (tenantID == null)
            {
                throw new ArgumentNullException(nameof(tenantID));
            }
            endpoint ??= new Uri("https://graph.windows.net");

            options ??= new RbacManagementClientOptions();
            _clientDiagnostics = new ClientDiagnostics(options);
            _pipeline = ManagementPipelineBuilder.Build(tokenCredential, endpoint, options);
            _tenantID = tenantID;
            _endpoint = endpoint;
        }

        /// <summary> Returns an instance of SignedInUserOperations. </summary>
        public virtual SignedInUserOperations SignedInUser => new SignedInUserOperations(_clientDiagnostics, _pipeline, _tenantID, _endpoint);

        /// <summary> Returns an instance of ApplicationsOperations. </summary>
        public virtual ApplicationsOperations Applications => new ApplicationsOperations(_clientDiagnostics, _pipeline, _tenantID, _endpoint);

        /// <summary> Returns an instance of DeletedApplicationsOperations. </summary>
        public virtual DeletedApplicationsOperations DeletedApplications => new DeletedApplicationsOperations(_clientDiagnostics, _pipeline, _tenantID, _endpoint);

        /// <summary> Returns an instance of GroupsOperations. </summary>
        public virtual GroupsOperations Groups => new GroupsOperations(_clientDiagnostics, _pipeline, _tenantID, _endpoint);

        /// <summary> Returns an instance of ServicePrincipalsOperations. </summary>
        public virtual ServicePrincipalsOperations ServicePrincipals => new ServicePrincipalsOperations(_clientDiagnostics, _pipeline, _tenantID, _endpoint);

        /// <summary> Returns an instance of UsersOperations. </summary>
        public virtual UsersOperations Users => new UsersOperations(_clientDiagnostics, _pipeline, _tenantID, _endpoint);

        /// <summary> Returns an instance of ObjectsOperations. </summary>
        public virtual ObjectsOperations Objects => new ObjectsOperations(_clientDiagnostics, _pipeline, _tenantID, _endpoint);

        /// <summary> Returns an instance of DomainsOperations. </summary>
        public virtual DomainsOperations Domains => new DomainsOperations(_clientDiagnostics, _pipeline, _tenantID, _endpoint);

        /// <summary> Returns an instance of OAuth2PermissionGrantOperations. </summary>
        public virtual OAuth2PermissionGrantOperations OAuth2PermissionGrant => new OAuth2PermissionGrantOperations(_clientDiagnostics, _pipeline, _tenantID, _endpoint);
    }
}
