/// <summary> /// Gets the commitmentPlans associated with the Cognitive Services account. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. The name is case insensitive. /// </param> /// <param name='accountName'> /// The name of Cognitive Services account. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IPage <CommitmentPlan> > ListAsync(this ICommitmentPlansOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Retrieve an Azure ML commitment plan by its subscription, resource group /// and name. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The resource group name. /// </param> /// <param name='commitmentPlanName'> /// The Azure ML commitment plan name. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async System.Threading.Tasks.Task <CommitmentPlan> GetAsync(this ICommitmentPlansOperations operations, string resourceGroupName, string commitmentPlanName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, commitmentPlanName, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Gets the commitmentPlans associated with the Cognitive Services account. /// </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> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IPage <CommitmentPlan> > ListNextAsync(this ICommitmentPlansOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Initializes client properties. /// </summary> private void Initialize() { Accounts = new AccountsOperations(this); DeletedAccounts = new DeletedAccountsOperations(this); ResourceSkus = new ResourceSkusOperations(this); Operations = new Operations(this); CommitmentTiers = new CommitmentTiersOperations(this); PrivateEndpointConnections = new PrivateEndpointConnectionsOperations(this); PrivateLinkResources = new PrivateLinkResourcesOperations(this); Deployments = new DeploymentsOperations(this); CommitmentPlans = new CommitmentPlansOperations(this); BaseUri = new System.Uri("https://management.azure.com"); ApiVersion = "2021-10-01"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; SerializationSettings = new JsonSerializerSettings { Formatting = Newtonsoft.Json.Formatting.Indented, DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, ContractResolver = new ReadOnlyJsonContractResolver(), Converters = new List <JsonConverter> { new Iso8601TimeSpanConverter() } }; DeserializationSettings = new JsonSerializerSettings { DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, ContractResolver = new ReadOnlyJsonContractResolver(), Converters = new List <JsonConverter> { new Iso8601TimeSpanConverter() } }; CustomInitialize(); DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); }
/// <summary> /// Creates a new Azure ML commitment plan resource or updates an existing one. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='createOrUpdatePayload'> /// The payload to create or update the Azure ML commitment plan. /// </param> /// <param name='resourceGroupName'> /// The resource group name. /// </param> /// <param name='commitmentPlanName'> /// The Azure ML commitment plan name. /// </param> public static CommitmentPlan CreateOrUpdate(this ICommitmentPlansOperations operations, CommitmentPlan createOrUpdatePayload, string resourceGroupName, string commitmentPlanName) { return(System.Threading.Tasks.Task.Factory.StartNew(s => ((ICommitmentPlansOperations)s).CreateOrUpdateAsync(createOrUpdatePayload, resourceGroupName, commitmentPlanName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Retrieve all Azure ML commitment plans in a resource group. /// </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> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <Microsoft.Rest.Azure.IPage <CommitmentPlan> > ListInResourceGroupNextAsync(this ICommitmentPlansOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListInResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Retrieve all Azure ML commitment plans in a resource group. /// </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 Microsoft.Rest.Azure.IPage <CommitmentPlan> ListInResourceGroupNext(this ICommitmentPlansOperations operations, string nextPageLink) { return(System.Threading.Tasks.Task.Factory.StartNew(s => ((ICommitmentPlansOperations)s).ListInResourceGroupNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Remove an existing Azure ML commitment plan. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The resource group name. /// </param> /// <param name='commitmentPlanName'> /// The Azure ML commitment plan name. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async System.Threading.Tasks.Task RemoveAsync(this ICommitmentPlansOperations operations, string resourceGroupName, string commitmentPlanName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { await operations.RemoveWithHttpMessagesAsync(resourceGroupName, commitmentPlanName, null, cancellationToken).ConfigureAwait(false); }
/// <summary> /// Remove an existing Azure ML commitment plan. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The resource group name. /// </param> /// <param name='commitmentPlanName'> /// The Azure ML commitment plan name. /// </param> public static void Remove(this ICommitmentPlansOperations operations, string resourceGroupName, string commitmentPlanName) { System.Threading.Tasks.Task.Factory.StartNew(s => ((ICommitmentPlansOperations)s).RemoveAsync(resourceGroupName, commitmentPlanName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); }
/// <summary> /// Gets the specified commitmentPlans associated with the Cognitive Services /// account. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. The name is case insensitive. /// </param> /// <param name='accountName'> /// The name of Cognitive Services account. /// </param> /// <param name='commitmentPlanName'> /// The name of the commitmentPlan associated with the Cognitive Services /// Account /// </param> public static CommitmentPlan Get(this ICommitmentPlansOperations operations, string resourceGroupName, string accountName, string commitmentPlanName) { return(operations.GetAsync(resourceGroupName, accountName, commitmentPlanName).GetAwaiter().GetResult()); }
/// <summary> /// Gets the commitmentPlans associated with the Cognitive Services account. /// </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 <CommitmentPlan> ListNext(this ICommitmentPlansOperations operations, string nextPageLink) { return(operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult()); }
/// <summary> /// Deletes the specified commitmentPlan associated with the Cognitive Services /// account. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. The name is case insensitive. /// </param> /// <param name='accountName'> /// The name of Cognitive Services account. /// </param> /// <param name='commitmentPlanName'> /// The name of the commitmentPlan associated with the Cognitive Services /// Account /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task BeginDeleteAsync(this ICommitmentPlansOperations operations, string resourceGroupName, string accountName, string commitmentPlanName, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, commitmentPlanName, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Deletes the specified commitmentPlan associated with the Cognitive Services /// account. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. The name is case insensitive. /// </param> /// <param name='accountName'> /// The name of Cognitive Services account. /// </param> /// <param name='commitmentPlanName'> /// The name of the commitmentPlan associated with the Cognitive Services /// Account /// </param> public static void BeginDelete(this ICommitmentPlansOperations operations, string resourceGroupName, string accountName, string commitmentPlanName) { operations.BeginDeleteAsync(resourceGroupName, accountName, commitmentPlanName).GetAwaiter().GetResult(); }
/// <summary> /// Update the state of specified commitmentPlans associated with the Cognitive /// Services account. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. The name is case insensitive. /// </param> /// <param name='accountName'> /// The name of Cognitive Services account. /// </param> /// <param name='commitmentPlanName'> /// The name of the commitmentPlan associated with the Cognitive Services /// Account /// </param> /// <param name='commitmentPlan'> /// The commitmentPlan properties. /// </param> public static CommitmentPlan CreateOrUpdate(this ICommitmentPlansOperations operations, string resourceGroupName, string accountName, string commitmentPlanName, CommitmentPlan commitmentPlan) { return(operations.CreateOrUpdateAsync(resourceGroupName, accountName, commitmentPlanName, commitmentPlan).GetAwaiter().GetResult()); }