public virtual WebAppUpdateSlotConfigurationNamesOperation CreateOrUpdate(SlotConfigNamesResourceData slotConfigNames, bool waitForCompletion = true, CancellationToken cancellationToken = default) { if (slotConfigNames == null) { throw new ArgumentNullException(nameof(slotConfigNames)); } using var scope = _clientDiagnostics.CreateScope("SlotConfigNamesResource.CreateOrUpdate"); scope.Start(); try { var response = _webAppsRestClient.UpdateSlotConfigurationNames(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, slotConfigNames, cancellationToken); var operation = new WebAppUpdateSlotConfigurationNamesOperation(this, response); if (waitForCompletion) { operation.WaitForCompletion(cancellationToken); } return(operation); } catch (Exception e) { scope.Failed(e); throw; } }
internal SlotConfigNamesResource(ArmResource options, SlotConfigNamesResourceData resource) : base(options, resource.Id) { HasData = true; _data = resource; Parent = options; _clientDiagnostics = new ClientDiagnostics(ClientOptions); _webAppsRestClient = new WebAppsRestOperations(_clientDiagnostics, Pipeline, ClientOptions, BaseUri); }
internal SlotConfigNamesResource(ArmClient armClient, SlotConfigNamesResourceData data) : this(armClient, data.Id) { HasData = true; _data = data; }
public async virtual Task <SlotConfigNamesResourceCreateOrUpdateOperation> CreateOrUpdateAsync(bool waitForCompletion, SlotConfigNamesResourceData slotConfigNames, CancellationToken cancellationToken = default) { if (slotConfigNames == null) { throw new ArgumentNullException(nameof(slotConfigNames)); } using var scope = _slotConfigNamesResourceWebAppsClientDiagnostics.CreateScope("SlotConfigNamesResource.CreateOrUpdate"); scope.Start(); try { var response = await _slotConfigNamesResourceWebAppsRestClient.UpdateSlotConfigurationNamesAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, slotConfigNames, cancellationToken).ConfigureAwait(false); var operation = new SlotConfigNamesResourceCreateOrUpdateOperation(ArmClient, response); if (waitForCompletion) { await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); } return(operation); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual ArmOperation <SlotConfigNamesResource> CreateOrUpdate(WaitUntil waitUntil, SlotConfigNamesResourceData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); using var scope = _slotConfigNamesResourceWebAppsClientDiagnostics.CreateScope("SlotConfigNamesResource.CreateOrUpdate"); scope.Start(); try { var response = _slotConfigNamesResourceWebAppsRestClient.UpdateSlotConfigurationNames(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, data, cancellationToken); var operation = new AppServiceArmOperation <SlotConfigNamesResource>(Response.FromValue(new SlotConfigNamesResource(Client, response), response.GetRawResponse())); if (waitUntil == WaitUntil.Completed) { operation.WaitForCompletion(cancellationToken); } return(operation); } catch (Exception e) { scope.Failed(e); throw; } }
public async virtual Task <ArmOperation <SlotConfigNamesResource> > CreateOrUpdateAsync(bool waitForCompletion, SlotConfigNamesResourceData slotConfigNames, CancellationToken cancellationToken = default) { Argument.AssertNotNull(slotConfigNames, nameof(slotConfigNames)); using var scope = _slotConfigNamesResourceWebAppsClientDiagnostics.CreateScope("SlotConfigNamesResource.CreateOrUpdate"); scope.Start(); try { var response = await _slotConfigNamesResourceWebAppsRestClient.UpdateSlotConfigurationNamesAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, slotConfigNames, cancellationToken).ConfigureAwait(false); var operation = new AppServiceArmOperation <SlotConfigNamesResource>(Response.FromValue(new SlotConfigNamesResource(Client, response), response.GetRawResponse())); if (waitForCompletion) { await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); } return(operation); } catch (Exception e) { scope.Failed(e); throw; } }