Exemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the ServerManagementClient class.
 /// </summary>
 /// <param name='credentials'>
 /// Required. Credentials needed for the client to connect to Azure.
 /// </param>
 /// <param name='handlers'>
 /// Optional. The delegating handlers to add to the http client pipeline.
 /// </param>
 /// <exception cref="System.ArgumentNullException">
 /// Thrown when a required parameter is null
 /// </exception>
 public ServerManagementClient(Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers)
 {
     if (credentials == null)
     {
         throw new System.ArgumentNullException("credentials");
     }
     this.Credentials = credentials;
     if (this.Credentials != null)
     {
         this.Credentials.InitializeServiceClient(this);
     }
 }
 /// <summary>
 /// Initializes a new instance of the AutoRestParameterGroupingTestService class.
 /// </summary>
 /// <param name='credentials'>
 /// Required. Credentials needed for the client to connect to Azure.
 /// </param>
 /// <param name='rootHandler'>
 /// Optional. The http client handler used to handle http transport.
 /// </param>
 /// <param name='handlers'>
 /// Optional. The delegating handlers to add to the http client pipeline.
 /// </param>
 /// <exception cref="System.ArgumentNullException">
 /// Thrown when a required parameter is null
 /// </exception>
 public AutoRestParameterGroupingTestService(Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers)
 {
     if (credentials == null)
     {
         throw new System.ArgumentNullException("credentials");
     }
     this.Credentials = credentials;
     if (this.Credentials != null)
     {
         this.Credentials.InitializeServiceClient(this);
     }
 }
 /// <summary>
 /// Initializes a new instance of the BookFastBookingAPI class.
 /// </summary>
 /// <param name='credentials'>
 /// Required. Subscription credentials which uniquely identify client subscription.
 /// </param>
 /// <param name='rootHandler'>
 /// Optional. The http client handler used to handle http transport.
 /// </param>
 /// <param name='handlers'>
 /// Optional. The delegating handlers to add to the http client pipeline.
 /// </param>
 /// <exception cref="System.ArgumentNullException">
 /// Thrown when a required parameter is null
 /// </exception>
 public BookFastBookingAPI(Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers)
 {
     if (credentials == null)
     {
         throw new System.ArgumentNullException(nameof(credentials));
     }
     this.Credentials = credentials;
     if (this.Credentials != null)
     {
         this.Credentials.InitializeServiceClient(this);
     }
 }
 /// <summary>
 /// Initializes a new instance of the AzureMLCommitmentPlansManagementClient class.
 /// </summary>
 /// <param name='credentials'>
 /// Required. Credentials needed for the client to connect to Azure.
 /// </param>
 /// <param name='rootHandler'>
 /// Optional. The http client handler used to handle http transport.
 /// </param>
 /// <param name='handlers'>
 /// Optional. The delegating handlers to add to the http client pipeline.
 /// </param>
 /// <exception cref="System.ArgumentNullException">
 /// Thrown when a required parameter is null
 /// </exception>
 public AzureMLCommitmentPlansManagementClient(Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers)
 {
     if (credentials == null)
     {
         throw new System.ArgumentNullException("credentials");
     }
     this.Credentials = credentials;
     if (this.Credentials != null)
     {
         this.Credentials.InitializeServiceClient(this);
     }
 }
        public void Authenticate()
        {
            string CLIENTID           = "1950a258-227b-4e31-a9cf-717495945fc2"; // Re-use the Azure PowerShell client id, in production code you should create your own client id
            var    ARM_TOKEN_AUDIENCE = new System.Uri(@"https://management.core.windows.net/");
            var    ADL_TOKEN_AUDIENCE = new System.Uri(@"https://datalake.azure.net/");
            var    AAD_TOKEN_AUDIENCE = new System.Uri(@"https://graph.windows.net/");

            var tokenCache = GetTokenCache(this.GetTokenCachePath());

            this.ARMCreds = GetCreds_User_Popup(this.Tenant, ARM_TOKEN_AUDIENCE, CLIENTID, tokenCache);
            this.ADLCreds = GetCreds_User_Popup(this.Tenant, ADL_TOKEN_AUDIENCE, CLIENTID, tokenCache);
            this.AADCreds = GetCreds_User_Popup(this.Tenant, AAD_TOKEN_AUDIENCE, CLIENTID, tokenCache);
        }
 /// <summary>
 /// Initializes a new instance of the AutoRestParameterGroupingTestService class.
 /// </summary>
 /// <param name='baseUri'>
 /// Optional. The base URI of the service.
 /// </param>
 /// <param name='credentials'>
 /// Required. Credentials needed for the client to connect to Azure.
 /// </param>
 /// <param name='handlers'>
 /// Optional. The delegating handlers to add to the http client pipeline.
 /// </param>
 /// <exception cref="System.ArgumentNullException">
 /// Thrown when a required parameter is null
 /// </exception>
 public AutoRestParameterGroupingTestService(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers)
 {
     if (baseUri == null)
     {
         throw new System.ArgumentNullException("baseUri");
     }
     if (credentials == null)
     {
         throw new System.ArgumentNullException("credentials");
     }
     this.BaseUri     = baseUri;
     this.Credentials = credentials;
     if (this.Credentials != null)
     {
         this.Credentials.InitializeServiceClient(this);
     }
 }
Exemplo n.º 7
0
 /// <summary>
 /// Initializes a new instance of the ServerManagementClient class.
 /// </summary>
 /// <param name='baseUri'>
 /// Optional. The base URI of the service.
 /// </param>
 /// <param name='credentials'>
 /// Required. Credentials needed for the client to connect to Azure.
 /// </param>
 /// <param name='rootHandler'>
 /// Optional. The http client handler used to handle http transport.
 /// </param>
 /// <param name='handlers'>
 /// Optional. The delegating handlers to add to the http client pipeline.
 /// </param>
 /// <exception cref="System.ArgumentNullException">
 /// Thrown when a required parameter is null
 /// </exception>
 public ServerManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers)
 {
     if (baseUri == null)
     {
         throw new System.ArgumentNullException("baseUri");
     }
     if (credentials == null)
     {
         throw new System.ArgumentNullException("credentials");
     }
     this.BaseUri     = baseUri;
     this.Credentials = credentials;
     if (this.Credentials != null)
     {
         this.Credentials.InitializeServiceClient(this);
     }
 }
 /// <summary>
 /// Initializes a new instance of the BookFastBookingAPI class.
 /// </summary>
 /// <param name='baseUri'>
 /// Optional. The base URI of the service.
 /// </param>
 /// <param name='credentials'>
 /// Required. Subscription credentials which uniquely identify client subscription.
 /// </param>
 /// <param name='handlers'>
 /// Optional. The delegating handlers to add to the http client pipeline.
 /// </param>
 /// <exception cref="System.ArgumentNullException">
 /// Thrown when a required parameter is null
 /// </exception>
 public BookFastBookingAPI(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers)
 {
     if (baseUri == null)
     {
         throw new System.ArgumentNullException(nameof(baseUri));
     }
     if (credentials == null)
     {
         throw new System.ArgumentNullException(nameof(credentials));
     }
     this.BaseUri     = baseUri;
     this.Credentials = credentials;
     if (this.Credentials != null)
     {
         this.Credentials.InitializeServiceClient(this);
     }
 }