/// <summary> /// Updates the details of a subscription specified by its identifier. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='serviceName'> /// The name of the API Management service. /// </param> /// <param name='sid'> /// Subscription entity Identifier. The entity represents the association /// between a user and a product in API Management. /// </param> /// <param name='parameters'> /// Update parameters. /// </param> /// <param name='ifMatch'> /// ETag of the Entity. ETag should match the current entity state from the /// header response of the GET request or it should be * for unconditional /// update. /// </param> /// <param name='notify'> /// Notify change in Subscription State. /// - If false, do not send any email notification for change of state of /// subscription /// - If true, send email notification of change of state of subscription /// </param> public static void Update(this ISubscriptionOperations operations, string resourceGroupName, string serviceName, string sid, SubscriptionUpdateParameters parameters, string ifMatch, bool?notify = default(bool?)) { operations.UpdateAsync(resourceGroupName, serviceName, sid, parameters, ifMatch, notify).GetAwaiter().GetResult(); }
/// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Subscriptions.ISubscriptionOperations. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static Task <SubscriptionListOperationResponse> ListAsync(this ISubscriptionOperations operations) { return(operations.ListAsync(CancellationToken.None)); }
/// <summary> /// Unregister a resource with your subscription. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Internal.Management.Rdfe.ISubscriptionOperations. /// </param> /// <param name='resourceName'> /// Required. Name of the resource to unregister. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static Task <AzureOperationResponse> UnregisterResourceAsync(this ISubscriptionOperations operations, string resourceName) { return(operations.UnregisterResourceAsync(resourceName, CancellationToken.None)); }
/// <summary> /// Your documentation here. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/XXXXX.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.AzureStack.Management.ISubscriptionOperations. /// </param> /// <param name='subscriptionId'> /// Optional. /// </param> /// <returns> /// Your documentation here. /// </returns> public static Task <SubscriptionGetResult> GetAsync(this ISubscriptionOperations operations, string subscriptionId) { return(operations.GetAsync(subscriptionId, CancellationToken.None)); }
/// <summary> /// Your documentation here. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/XXXXX.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.AzureStack.Management.ISubscriptionOperations. /// </param> /// <param name='nextLink'> /// Required. Your documentation here. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/XXXXX.aspx /// for more information) /// </param> /// <returns> /// Your documentation here. /// </returns> public static Task <SubscriptionListResult> ListNextAsync(this ISubscriptionOperations operations, string nextLink) { return(operations.ListNextAsync(nextLink, CancellationToken.None)); }
/// <summary> /// Creates an Azure subscription /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='enrollmentAccountName'> /// The name of the enrollment account to which the subscription will be /// billed. /// </param> /// <param name='body'> /// The subscription creation parameters. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <SubscriptionCreationResult> CreateSubscriptionInEnrollmentAccountAsync(this ISubscriptionOperations operations, string enrollmentAccountName, SubscriptionCreationParameters body, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateSubscriptionInEnrollmentAccountWithHttpMessagesAsync(enrollmentAccountName, body, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Initializes a new instance of the SubscriptionClient class. /// </summary> private SubscriptionClient() : base() { this._subscriptions = new SubscriptionOperations(this); this.HttpClient.Timeout = TimeSpan.FromSeconds(300); }
/// <summary> /// Regenerates secondary key of existing subscription of the API Management /// service instance. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='serviceName'> /// The name of the API Management service. /// </param> /// <param name='sid'> /// Subscription entity Identifier. The entity represents the association /// between a user and a product in API Management. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task RegenerateSecondaryKeyAsync(this ISubscriptionOperations operations, string resourceGroupName, string serviceName, string sid, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.RegenerateSecondaryKeyWithHttpMessagesAsync(resourceGroupName, serviceName, sid, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Gets the subscription keys. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='serviceName'> /// The name of the API Management service. /// </param> /// <param name='sid'> /// Subscription entity Identifier. The entity represents the association /// between a user and a product in API Management. /// </param> public static SubscriptionKeysContract ListSecrets(this ISubscriptionOperations operations, string resourceGroupName, string serviceName, string sid) { return(operations.ListSecretsAsync(resourceGroupName, serviceName, sid).GetAwaiter().GetResult()); }
/// <summary> /// Lists all subscriptions of the API Management service instance. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='serviceName'> /// The name of the API Management service. /// </param> /// <param name='odataQuery'> /// OData parameters to apply to the operation. /// </param> public static IPage <SubscriptionContract> List(this ISubscriptionOperations operations, string resourceGroupName, string serviceName, ODataQuery <SubscriptionContract> odataQuery = default(ODataQuery <SubscriptionContract>)) { return(operations.ListAsync(resourceGroupName, serviceName, odataQuery).GetAwaiter().GetResult()); }
/// <summary> /// Regenerates secondary key of existing subscription of the API Management /// service instance. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='serviceName'> /// The name of the API Management service. /// </param> /// <param name='sid'> /// Subscription entity Identifier. The entity represents the association /// between a user and a product in API Management. /// </param> public static void RegenerateSecondaryKey(this ISubscriptionOperations operations, string resourceGroupName, string serviceName, string sid) { operations.RegenerateSecondaryKeyAsync(resourceGroupName, serviceName, sid).GetAwaiter().GetResult(); }
/// <summary> /// Deletes the specified subscription. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='serviceName'> /// The name of the API Management service. /// </param> /// <param name='sid'> /// Subscription entity Identifier. The entity represents the association /// between a user and a product in API Management. /// </param> /// <param name='ifMatch'> /// ETag of the Entity. ETag should match the current entity state from the /// header response of the GET request or it should be * for unconditional /// update. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task DeleteAsync(this ISubscriptionOperations operations, string resourceGroupName, string serviceName, string sid, string ifMatch, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serviceName, sid, ifMatch, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Deletes the specified subscription. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='serviceName'> /// The name of the API Management service. /// </param> /// <param name='sid'> /// Subscription entity Identifier. The entity represents the association /// between a user and a product in API Management. /// </param> /// <param name='ifMatch'> /// ETag of the Entity. ETag should match the current entity state from the /// header response of the GET request or it should be * for unconditional /// update. /// </param> public static void Delete(this ISubscriptionOperations operations, string resourceGroupName, string serviceName, string sid, string ifMatch) { operations.DeleteAsync(resourceGroupName, serviceName, sid, ifMatch).GetAwaiter().GetResult(); }
/// <summary> /// Updates the details of a subscription specified by its identifier. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='serviceName'> /// The name of the API Management service. /// </param> /// <param name='sid'> /// Subscription entity Identifier. The entity represents the association /// between a user and a product in API Management. /// </param> /// <param name='parameters'> /// Update parameters. /// </param> /// <param name='ifMatch'> /// ETag of the Entity. ETag should match the current entity state from the /// header response of the GET request or it should be * for unconditional /// update. /// </param> /// <param name='notify'> /// Notify change in Subscription State. /// - If false, do not send any email notification for change of state of /// subscription /// - If true, send email notification of change of state of subscription /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task UpdateAsync(this ISubscriptionOperations operations, string resourceGroupName, string serviceName, string sid, SubscriptionUpdateParameters parameters, string ifMatch, bool?notify = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) { (await operations.UpdateWithHttpMessagesAsync(resourceGroupName, serviceName, sid, parameters, ifMatch, notify, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// The operation to create a new CSP subscription. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='billingAccountName'> /// The name of the Microsoft Customer Agreement billing account for which you /// want to create the subscription. /// </param> /// <param name='customerName'> /// The name of the customer. /// </param> /// <param name='body'> /// The subscription creation parameters. /// </param> public static SubscriptionCreationResult BeginCreateCspSubscription(this ISubscriptionOperations operations, string billingAccountName, string customerName, ModernCspSubscriptionCreationParameters body) { return(operations.BeginCreateCspSubscriptionAsync(billingAccountName, customerName, body).GetAwaiter().GetResult()); }
/// <summary> /// Lists all subscriptions of the API Management service instance. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='nextPageLink'> /// The NextLink from the previous successful call to List operation. /// </param> public static IPage <SubscriptionContract> ListNext(this ISubscriptionOperations operations, string nextPageLink) { return(operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult()); }
/// <summary> /// The operation to create a new CSP subscription. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='billingAccountName'> /// The name of the Microsoft Customer Agreement billing account for which you /// want to create the subscription. /// </param> /// <param name='customerName'> /// The name of the customer. /// </param> /// <param name='body'> /// The subscription creation parameters. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <SubscriptionCreationResult> BeginCreateCspSubscriptionAsync(this ISubscriptionOperations operations, string billingAccountName, string customerName, ModernCspSubscriptionCreationParameters body, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.BeginCreateCspSubscriptionWithHttpMessagesAsync(billingAccountName, customerName, body, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Gets the entity state (Etag) version of the apimanagement subscription /// specified by its identifier. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='serviceName'> /// The name of the API Management service. /// </param> /// <param name='sid'> /// Subscription entity Identifier. The entity represents the association /// between a user and a product in API Management. /// </param> public static SubscriptionGetEntityTagHeaders GetEntityTag(this ISubscriptionOperations operations, string resourceGroupName, string serviceName, string sid) { return(operations.GetEntityTagAsync(resourceGroupName, serviceName, sid).GetAwaiter().GetResult()); }
/// <summary> /// The operation to cancel a subscription /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='subscriptionId'> /// Subscription Id. /// </param> public static CanceledSubscriptionId Cancel(this ISubscriptionOperations operations, string subscriptionId) { return(operations.CancelAsync(subscriptionId).GetAwaiter().GetResult()); }
/// <summary> /// The operation to rename a subscription /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='subscriptionId'> /// Subscription Id. /// </param> /// <param name='body'> /// Subscription Name /// </param> public static RenamedSubscriptionId Rename(this ISubscriptionOperations operations, string subscriptionId, SubscriptionName body) { return(operations.RenameAsync(subscriptionId, body).GetAwaiter().GetResult()); }
/// <summary> /// Your documentation here. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/XXXXX.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.AzureStack.Management.ISubscriptionOperations. /// </param> /// <param name='subscriptionId'> /// Required. Your documentation here. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static Task <AzureOperationResponse> DeleteAsync(this ISubscriptionOperations operations, string subscriptionId) { return(operations.DeleteAsync(subscriptionId, CancellationToken.None)); }
/// <summary> /// The operation to enable a subscription /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='subscriptionId'> /// Subscription Id. /// </param> public static EnabledSubscriptionId Enable(this ISubscriptionOperations operations, string subscriptionId) { return(operations.EnableAsync(subscriptionId).GetAwaiter().GetResult()); }
/// <summary> /// Your documentation here. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/XXXXX.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.AzureStack.Management.ISubscriptionOperations. /// </param> /// <param name='includeDetails'> /// Required. /// </param> /// <returns> /// Your documentation here. /// </returns> public static Task <SubscriptionListResult> ListAsync(this ISubscriptionOperations operations, bool includeDetails) { return(operations.ListAsync(includeDetails, CancellationToken.None)); }
/// <summary> /// The operation to create a new WebDirect or EA Azure subscription. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='billingAccountName'> /// The name of the Microsoft Customer Agreement billing account for which you /// want to create the subscription. /// </param> /// <param name='billingProfileName'> /// The name of the billing profile in the billing account for which you want /// to create the subscription. /// </param> /// <param name='invoiceSectionName'> /// The name of the invoice section in the billing account for which you want /// to create the subscription. /// </param> /// <param name='body'> /// The subscription creation parameters. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <SubscriptionCreationResult> CreateSubscriptionAsync(this ISubscriptionOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, ModernSubscriptionCreationParameters body, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateSubscriptionWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, body, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Your documentation here. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/XXXXX.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.AzureStack.Management.ISubscriptionOperations. /// </param> /// <param name='parameters'> /// Required. Your documentation here. /// </param> /// <returns> /// Your documentation here. /// </returns> public static Task <SubscriptionCreateOrUpdateResult> CreateOrUpdateAsync(this ISubscriptionOperations operations, SubscriptionCreateOrUpdateParameters parameters) { return(operations.CreateOrUpdateAsync(parameters, CancellationToken.None)); }
/// <summary> /// The operation to create a new WebDirect or EA Azure subscription. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='billingAccountName'> /// The name of the Microsoft Customer Agreement billing account for which you /// want to create the subscription. /// </param> /// <param name='billingProfileName'> /// The name of the billing profile in the billing account for which you want /// to create the subscription. /// </param> /// <param name='invoiceSectionName'> /// The name of the invoice section in the billing account for which you want /// to create the subscription. /// </param> /// <param name='body'> /// The subscription creation parameters. /// </param> public static SubscriptionCreationResult BeginCreateSubscription(this ISubscriptionOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, ModernSubscriptionCreationParameters body) { return(operations.BeginCreateSubscriptionAsync(billingAccountName, billingProfileName, invoiceSectionName, body).GetAwaiter().GetResult()); }
/// <summary> /// The List Subscription Operations operation returns a list of /// create, update, and delete operations that were performed on a /// subscription during the specified timeframe. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/gg715318.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Internal.Management.Rdfe.ISubscriptionOperations. /// </param> /// <param name='parameters'> /// Required. Parameters supplied to the List Subscription Operations /// operation. /// </param> /// <returns> /// The List Subscription Operations operation response. /// </returns> public static Task <SubscriptionListOperationsResponse> ListOperationsAsync(this ISubscriptionOperations operations, SubscriptionListOperationsParameters parameters) { return(operations.ListOperationsAsync(parameters, CancellationToken.None)); }
/// <summary> /// Creates an Azure subscription /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='enrollmentAccountName'> /// The name of the enrollment account to which the subscription will be /// billed. /// </param> /// <param name='body'> /// The subscription creation parameters. /// </param> public static SubscriptionCreationResult CreateSubscriptionInEnrollmentAccount(this ISubscriptionOperations operations, string enrollmentAccountName, SubscriptionCreationParameters body) { return(operations.CreateSubscriptionInEnrollmentAccountAsync(enrollmentAccountName, body).GetAwaiter().GetResult()); }
/// <summary> /// The Get Subscription operation returns account and resource /// allocation information for the specified subscription. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/hh403995.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Internal.Management.Rdfe.ISubscriptionOperations. /// </param> /// <returns> /// The Get Subscription operation response. /// </returns> public static Task <SubscriptionGetResponse> GetAsync(this ISubscriptionOperations operations) { return(operations.GetAsync(CancellationToken.None)); }
/// <summary> /// Creates or updates the subscription of specified user to the specified /// product. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='serviceName'> /// The name of the API Management service. /// </param> /// <param name='sid'> /// Subscription entity Identifier. The entity represents the association /// between a user and a product in API Management. /// </param> /// <param name='parameters'> /// Create parameters. /// </param> /// <param name='notify'> /// Notify change in Subscription State. /// - If false, do not send any email notification for change of state of /// subscription /// - If true, send email notification of change of state of subscription /// </param> /// <param name='ifMatch'> /// ETag of the Entity. Not required when creating an entity, but required when /// updating an entity. /// </param> public static SubscriptionContract CreateOrUpdate(this ISubscriptionOperations operations, string resourceGroupName, string serviceName, string sid, SubscriptionCreateParameters parameters, bool?notify = default(bool?), string ifMatch = default(string)) { return(operations.CreateOrUpdateAsync(resourceGroupName, serviceName, sid, parameters, notify, ifMatch).GetAwaiter().GetResult()); }