Exemple #1
0
        public virtual Response <RecordSetCnameResource> Update(CnameRecordSetData data, string ifMatch = null, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(data, nameof(data));

            using var scope = _recordSetCnameRecordSetsClientDiagnostics.CreateScope("RecordSetCnameResource.Update");
            scope.Start();
            try
            {
                var response = _recordSetCnameRecordSetsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, cancellationToken);
                return(Response.FromValue(new RecordSetCnameResource(Client, response.Value), response.GetRawResponse()));
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
Exemple #2
0
        public virtual async Task <ArmOperation <RecordSetCnameResource> > CreateOrUpdateAsync(WaitUntil waitUntil, string relativeRecordSetName, CnameRecordSetData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(relativeRecordSetName, nameof(relativeRecordSetName));
            Argument.AssertNotNull(data, nameof(data));

            using var scope = _recordSetCnameRecordSetsClientDiagnostics.CreateScope("RecordSetCnameCollection.CreateOrUpdate");
            scope.Start();
            try
            {
                var response = await _recordSetCnameRecordSetsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, relativeRecordSetName, data, ifMatch, ifNoneMatch, cancellationToken).ConfigureAwait(false);

                var operation = new DnsArmOperation <RecordSetCnameResource>(Response.FromValue(new RecordSetCnameResource(Client, response), response.GetRawResponse()));
                if (waitUntil == WaitUntil.Completed)
                {
                    await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
Exemple #3
0
 internal RecordSetCnameResource(ArmClient client, CnameRecordSetData data) : this(client, data.Id)
 {
     HasData = true;
     _data   = data;
 }