public virtual Response <RecordSetSrvResource> Update(SrvRecordSetData data, string ifMatch = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); using var scope = _recordSetSrvRecordSetsClientDiagnostics.CreateScope("RecordSetSrvResource.Update"); scope.Start(); try { var response = _recordSetSrvRecordSetsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, cancellationToken); return(Response.FromValue(new RecordSetSrvResource(Client, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual async Task <ArmOperation <RecordSetSrvResource> > CreateOrUpdateAsync(WaitUntil waitUntil, string relativeRecordSetName, SrvRecordSetData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(relativeRecordSetName, nameof(relativeRecordSetName)); Argument.AssertNotNull(data, nameof(data)); using var scope = _recordSetSrvRecordSetsClientDiagnostics.CreateScope("RecordSetSrvCollection.CreateOrUpdate"); scope.Start(); try { var response = await _recordSetSrvRecordSetsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, relativeRecordSetName, data, ifMatch, ifNoneMatch, cancellationToken).ConfigureAwait(false); var operation = new DnsArmOperation <RecordSetSrvResource>(Response.FromValue(new RecordSetSrvResource(Client, response), response.GetRawResponse())); if (waitUntil == WaitUntil.Completed) { await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); } return(operation); } catch (Exception e) { scope.Failed(e); throw; } }
internal RecordSetSrvResource(ArmClient client, SrvRecordSetData data) : this(client, data.Id) { HasData = true; _data = data; }