Example #1
0
        public virtual async Task <Response <ExpressRouteCrossConnectionResource> > UpdateAsync(TagsObject crossConnectionParameters, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(crossConnectionParameters, nameof(crossConnectionParameters));

            using var scope = _expressRouteCrossConnectionClientDiagnostics.CreateScope("ExpressRouteCrossConnectionResource.Update");
            scope.Start();
            try
            {
                var response = await _expressRouteCrossConnectionRestClient.UpdateTagsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, crossConnectionParameters, cancellationToken).ConfigureAwait(false);

                return(Response.FromValue(new ExpressRouteCrossConnectionResource(Client, response.Value), response.GetRawResponse()));
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
Example #2
0
        public virtual async Task <Response <ExpressRouteCrossConnection> > UpdateTagsAsync(TagsObject crossConnectionParameters, CancellationToken cancellationToken = default)
        {
            if (crossConnectionParameters == null)
            {
                throw new ArgumentNullException(nameof(crossConnectionParameters));
            }

            using var scope = _clientDiagnostics.CreateScope("ExpressRouteCrossConnection.UpdateTags");
            scope.Start();
            try
            {
                var response = await _restClient.UpdateTagsAsync(Id.ResourceGroupName, Id.Name, crossConnectionParameters, cancellationToken).ConfigureAwait(false);

                return(Response.FromValue(new ExpressRouteCrossConnection(this, response.Value), response.GetRawResponse()));
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }