Exemplo n.º 1
0
        public virtual ArmOperation <SqlRoleAssignmentResource> Update(WaitUntil waitUntil, SqlRoleAssignmentCreateOrUpdateContent content, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(content, nameof(content));

            using var scope = _sqlRoleAssignmentSqlResourcesClientDiagnostics.CreateScope("SqlRoleAssignmentResource.Update");
            scope.Start();
            try
            {
                var response  = _sqlRoleAssignmentSqlResourcesRestClient.CreateUpdateSqlRoleAssignment(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken);
                var operation = new CosmosDBArmOperation <SqlRoleAssignmentResource>(new SqlRoleAssignmentOperationSource(Client), _sqlRoleAssignmentSqlResourcesClientDiagnostics, Pipeline, _sqlRoleAssignmentSqlResourcesRestClient.CreateCreateUpdateSqlRoleAssignmentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location);
                if (waitUntil == WaitUntil.Completed)
                {
                    operation.WaitForCompletion(cancellationToken);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }