Exemplo n.º 1
0
        public virtual Response <TagResource> Update(PatchableTagResourceData data, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(data, nameof(data));

            using var scope = _tagResourceTagsClientDiagnostics.CreateScope("TagResource.Update");
            scope.Start();
            try
            {
                var response = _tagResourceTagsRestClient.UpdateAtScope(Id.Parent, data, cancellationToken);
                return(Response.FromValue(new TagResource(Client, response.Value), response.GetRawResponse()));
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
        public virtual Response <TagResource> Update(TagPatchResource parameters, CancellationToken cancellationToken = default)
        {
            if (parameters == null)
            {
                throw new ArgumentNullException(nameof(parameters));
            }

            using var scope = _tagResourceTagsClientDiagnostics.CreateScope("TagResource.Update");
            scope.Start();
            try
            {
                var response = _tagResourceTagsRestClient.UpdateAtScope(Id.Parent, parameters, cancellationToken);
                return(Response.FromValue(new TagResource(ArmClient, response.Value), response.GetRawResponse()));
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }