public virtual async Task <ArmOperation <SqlRoleAssignmentResource> > CreateOrUpdateAsync(WaitUntil waitUntil, string roleAssignmentId, SqlRoleAssignmentCreateOrUpdateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); Argument.AssertNotNull(content, nameof(content)); using var scope = _sqlRoleAssignmentSqlResourcesClientDiagnostics.CreateScope("SqlRoleAssignmentCollection.CreateOrUpdate"); scope.Start(); try { var response = await _sqlRoleAssignmentSqlResourcesRestClient.CreateUpdateSqlRoleAssignmentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleAssignmentId, content, cancellationToken).ConfigureAwait(false); var operation = new CosmosDBArmOperation <SqlRoleAssignmentResource>(new SqlRoleAssignmentOperationSource(Client), _sqlRoleAssignmentSqlResourcesClientDiagnostics, Pipeline, _sqlRoleAssignmentSqlResourcesRestClient.CreateCreateUpdateSqlRoleAssignmentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleAssignmentId, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) { await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); } return(operation); } catch (Exception e) { scope.Failed(e); throw; } }