public async virtual Task <WebAppCreateOrUpdateDomainOwnershipIdentifierSlotOperation> CreateOrUpdateAsync(string domainOwnershipIdentifierName, IdentifierData domainOwnershipIdentifier, bool waitForCompletion = true, CancellationToken cancellationToken = default) { if (domainOwnershipIdentifierName == null) { throw new ArgumentNullException(nameof(domainOwnershipIdentifierName)); } if (domainOwnershipIdentifier == null) { throw new ArgumentNullException(nameof(domainOwnershipIdentifier)); } using var scope = _clientDiagnostics.CreateScope("SiteSlotDomainOwnershipIdentifierCollection.CreateOrUpdate"); scope.Start(); try { var response = await _webAppsRestClient.CreateOrUpdateDomainOwnershipIdentifierSlotAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, domainOwnershipIdentifierName, domainOwnershipIdentifier, cancellationToken).ConfigureAwait(false); var operation = new WebAppCreateOrUpdateDomainOwnershipIdentifierSlotOperation(Parent, response); if (waitForCompletion) { await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); } return(operation); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual async Task <ArmOperation <SiteSlotDomainOwnershipIdentifierResource> > CreateOrUpdateAsync(WaitUntil waitUntil, string domainOwnershipIdentifierName, IdentifierData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(domainOwnershipIdentifierName, nameof(domainOwnershipIdentifierName)); Argument.AssertNotNull(data, nameof(data)); using var scope = _siteSlotDomainOwnershipIdentifierWebAppsClientDiagnostics.CreateScope("SiteSlotDomainOwnershipIdentifierCollection.CreateOrUpdate"); scope.Start(); try { var response = await _siteSlotDomainOwnershipIdentifierWebAppsRestClient.CreateOrUpdateDomainOwnershipIdentifierSlotAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, domainOwnershipIdentifierName, data, cancellationToken).ConfigureAwait(false); var operation = new AppServiceArmOperation <SiteSlotDomainOwnershipIdentifierResource>(Response.FromValue(new SiteSlotDomainOwnershipIdentifierResource(Client, response), response.GetRawResponse())); if (waitUntil == WaitUntil.Completed) { await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); } return(operation); } catch (Exception e) { scope.Failed(e); throw; } }