Class UserServiceClient
UserService client wrapper, for convenient use.
Namespace: Google.Shopping.Merchant.Accounts.V1Beta
Assembly: Google.Shopping.Merchant.Accounts.V1Beta.dll
Syntax
public abstract class UserServiceClient
Remarks
Service to support user API.
Properties
DefaultEndpoint
The default endpoint for the UserService service, which is a host of "merchantapi.googleapis.com" and a port of 443.
Declaration
public static string DefaultEndpoint { get; }
Property Value
| Type | Description |
|---|---|
| string |
DefaultScopes
The default UserService scopes.
Declaration
public static IReadOnlyList<string> DefaultScopes { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<string> |
Remarks
The default UserService scopes are:
- https://www.googleapis.com/auth/content
GrpcClient
The underlying gRPC UserService client
Declaration
public virtual UserService.UserServiceClient GrpcClient { get; }
Property Value
| Type | Description |
|---|---|
| UserService.UserServiceClient |
ServiceMetadata
The service metadata associated with this client type.
Declaration
public static ServiceMetadata ServiceMetadata { get; }
Property Value
| Type | Description |
|---|---|
| ServiceMetadata |
Methods
Create()
Synchronously creates a UserServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use UserServiceClientBuilder.
Declaration
public static UserServiceClient Create()
Returns
| Type | Description |
|---|---|
| UserServiceClient | The created UserServiceClient. |
CreateAsync(CancellationToken)
Asynchronously creates a UserServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use UserServiceClientBuilder.
Declaration
public static Task<UserServiceClient> CreateAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | The CancellationToken to use while creating the client. |
Returns
| Type | Description |
|---|---|
| Task<UserServiceClient> | The task representing the created UserServiceClient. |
CreateUser(AccountName, User, CallSettings)
Creates a Merchant Center account user. Executing this method requires admin access.
Declaration
public virtual User CreateUser(AccountName parent, User user, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| AccountName | parent | Required. The resource name of the account for which a user will be
created. Format: |
| User | user | Required. The user to create. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| User | The RPC response. |
Sample code
// Create client
UserServiceClient userServiceClient = UserServiceClient.Create();
// Initialize request argument(s)
AccountName parent = AccountName.FromAccount("[ACCOUNT]");
User user = new User();
// Make the request
User response = userServiceClient.CreateUser(parent, user);
CreateUser(CreateUserRequest, CallSettings)
Creates a Merchant Center account user. Executing this method requires admin access.
Declaration
public virtual User CreateUser(CreateUserRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| CreateUserRequest | request | The request object containing all of the parameters for the API call. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| User | The RPC response. |
Sample code
// Create client
UserServiceClient userServiceClient = UserServiceClient.Create();
// Initialize request argument(s)
CreateUserRequest request = new CreateUserRequest
{
ParentAsAccountName = AccountName.FromAccount("[ACCOUNT]"),
UserId = "",
User = new User(),
};
// Make the request
User response = userServiceClient.CreateUser(request);
CreateUser(string, User, CallSettings)
Creates a Merchant Center account user. Executing this method requires admin access.
Declaration
public virtual User CreateUser(string parent, User user, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | parent | Required. The resource name of the account for which a user will be
created. Format: |
| User | user | Required. The user to create. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| User | The RPC response. |
Sample code
// Create client
UserServiceClient userServiceClient = UserServiceClient.Create();
// Initialize request argument(s)
string parent = "accounts/[ACCOUNT]";
User user = new User();
// Make the request
User response = userServiceClient.CreateUser(parent, user);
CreateUserAsync(AccountName, User, CallSettings)
Creates a Merchant Center account user. Executing this method requires admin access.
Declaration
public virtual Task<User> CreateUserAsync(AccountName parent, User user, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| AccountName | parent | Required. The resource name of the account for which a user will be
created. Format: |
| User | user | Required. The user to create. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<User> | A Task containing the RPC response. |
Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
AccountName parent = AccountName.FromAccount("[ACCOUNT]");
User user = new User();
// Make the request
User response = await userServiceClient.CreateUserAsync(parent, user);
CreateUserAsync(AccountName, User, CancellationToken)
Creates a Merchant Center account user. Executing this method requires admin access.
Declaration
public virtual Task<User> CreateUserAsync(AccountName parent, User user, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| AccountName | parent | Required. The resource name of the account for which a user will be
created. Format: |
| User | user | Required. The user to create. |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<User> | A Task containing the RPC response. |
Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
AccountName parent = AccountName.FromAccount("[ACCOUNT]");
User user = new User();
// Make the request
User response = await userServiceClient.CreateUserAsync(parent, user);
CreateUserAsync(CreateUserRequest, CallSettings)
Creates a Merchant Center account user. Executing this method requires admin access.
Declaration
public virtual Task<User> CreateUserAsync(CreateUserRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| CreateUserRequest | request | The request object containing all of the parameters for the API call. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<User> | A Task containing the RPC response. |
Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
CreateUserRequest request = new CreateUserRequest
{
ParentAsAccountName = AccountName.FromAccount("[ACCOUNT]"),
UserId = "",
User = new User(),
};
// Make the request
User response = await userServiceClient.CreateUserAsync(request);
CreateUserAsync(CreateUserRequest, CancellationToken)
Creates a Merchant Center account user. Executing this method requires admin access.
Declaration
public virtual Task<User> CreateUserAsync(CreateUserRequest request, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| CreateUserRequest | request | The request object containing all of the parameters for the API call. |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<User> | A Task containing the RPC response. |
Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
CreateUserRequest request = new CreateUserRequest
{
ParentAsAccountName = AccountName.FromAccount("[ACCOUNT]"),
UserId = "",
User = new User(),
};
// Make the request
User response = await userServiceClient.CreateUserAsync(request);
CreateUserAsync(string, User, CallSettings)
Creates a Merchant Center account user. Executing this method requires admin access.
Declaration
public virtual Task<User> CreateUserAsync(string parent, User user, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | parent | Required. The resource name of the account for which a user will be
created. Format: |
| User | user | Required. The user to create. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<User> | A Task containing the RPC response. |
Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "accounts/[ACCOUNT]";
User user = new User();
// Make the request
User response = await userServiceClient.CreateUserAsync(parent, user);
CreateUserAsync(string, User, CancellationToken)
Creates a Merchant Center account user. Executing this method requires admin access.
Declaration
public virtual Task<User> CreateUserAsync(string parent, User user, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| string | parent | Required. The resource name of the account for which a user will be
created. Format: |
| User | user | Required. The user to create. |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<User> | A Task containing the RPC response. |
Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "accounts/[ACCOUNT]";
User user = new User();
// Make the request
User response = await userServiceClient.CreateUserAsync(parent, user);
DeleteUser(DeleteUserRequest, CallSettings)
Deletes a Merchant Center account user. Executing this method requires admin access.
Declaration
public virtual void DeleteUser(DeleteUserRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| DeleteUserRequest | request | The request object containing all of the parameters for the API call. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Sample code
// Create client
UserServiceClient userServiceClient = UserServiceClient.Create();
// Initialize request argument(s)
DeleteUserRequest request = new DeleteUserRequest
{
UserName = UserName.FromAccountEmail("[ACCOUNT]", "[EMAIL]"),
};
// Make the request
userServiceClient.DeleteUser(request);
DeleteUser(UserName, CallSettings)
Deletes a Merchant Center account user. Executing this method requires admin access.
Declaration
public virtual void DeleteUser(UserName name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| UserName | name | Required. The name of the user to delete.
Format: It is also possible to delete the user corresponding to the caller by using
|
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Sample code
// Create client
UserServiceClient userServiceClient = UserServiceClient.Create();
// Initialize request argument(s)
UserName name = UserName.FromAccountEmail("[ACCOUNT]", "[EMAIL]");
// Make the request
userServiceClient.DeleteUser(name);
DeleteUser(string, CallSettings)
Deletes a Merchant Center account user. Executing this method requires admin access.
Declaration
public virtual void DeleteUser(string name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Required. The name of the user to delete.
Format: It is also possible to delete the user corresponding to the caller by using
|
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Sample code
// Create client
UserServiceClient userServiceClient = UserServiceClient.Create();
// Initialize request argument(s)
string name = "accounts/[ACCOUNT]/users/[EMAIL]";
// Make the request
userServiceClient.DeleteUser(name);
DeleteUserAsync(DeleteUserRequest, CallSettings)
Deletes a Merchant Center account user. Executing this method requires admin access.
Declaration
public virtual Task DeleteUserAsync(DeleteUserRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| DeleteUserRequest | request | The request object containing all of the parameters for the API call. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task | A Task containing the RPC response. |
Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteUserRequest request = new DeleteUserRequest
{
UserName = UserName.FromAccountEmail("[ACCOUNT]", "[EMAIL]"),
};
// Make the request
await userServiceClient.DeleteUserAsync(request);
DeleteUserAsync(DeleteUserRequest, CancellationToken)
Deletes a Merchant Center account user. Executing this method requires admin access.
Declaration
public virtual Task DeleteUserAsync(DeleteUserRequest request, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| DeleteUserRequest | request | The request object containing all of the parameters for the API call. |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task | A Task containing the RPC response. |
Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteUserRequest request = new DeleteUserRequest
{
UserName = UserName.FromAccountEmail("[ACCOUNT]", "[EMAIL]"),
};
// Make the request
await userServiceClient.DeleteUserAsync(request);
DeleteUserAsync(UserName, CallSettings)
Deletes a Merchant Center account user. Executing this method requires admin access.
Declaration
public virtual Task DeleteUserAsync(UserName name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| UserName | name | Required. The name of the user to delete.
Format: It is also possible to delete the user corresponding to the caller by using
|
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task | A Task containing the RPC response. |
Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
UserName name = UserName.FromAccountEmail("[ACCOUNT]", "[EMAIL]");
// Make the request
await userServiceClient.DeleteUserAsync(name);
DeleteUserAsync(UserName, CancellationToken)
Deletes a Merchant Center account user. Executing this method requires admin access.
Declaration
public virtual Task DeleteUserAsync(UserName name, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| UserName | name | Required. The name of the user to delete.
Format: It is also possible to delete the user corresponding to the caller by using
|
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task | A Task containing the RPC response. |
Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
UserName name = UserName.FromAccountEmail("[ACCOUNT]", "[EMAIL]");
// Make the request
await userServiceClient.DeleteUserAsync(name);
DeleteUserAsync(string, CallSettings)
Deletes a Merchant Center account user. Executing this method requires admin access.
Declaration
public virtual Task DeleteUserAsync(string name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Required. The name of the user to delete.
Format: It is also possible to delete the user corresponding to the caller by using
|
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task | A Task containing the RPC response. |
Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "accounts/[ACCOUNT]/users/[EMAIL]";
// Make the request
await userServiceClient.DeleteUserAsync(name);
DeleteUserAsync(string, CancellationToken)
Deletes a Merchant Center account user. Executing this method requires admin access.
Declaration
public virtual Task DeleteUserAsync(string name, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Required. The name of the user to delete.
Format: It is also possible to delete the user corresponding to the caller by using
|
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task | A Task containing the RPC response. |
Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "accounts/[ACCOUNT]/users/[EMAIL]";
// Make the request
await userServiceClient.DeleteUserAsync(name);
GetUser(GetUserRequest, CallSettings)
Retrieves a Merchant Center account user.
Declaration
public virtual User GetUser(GetUserRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| GetUserRequest | request | The request object containing all of the parameters for the API call. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| User | The RPC response. |
Sample code
// Create client
UserServiceClient userServiceClient = UserServiceClient.Create();
// Initialize request argument(s)
GetUserRequest request = new GetUserRequest
{
UserName = UserName.FromAccountEmail("[ACCOUNT]", "[EMAIL]"),
};
// Make the request
User response = userServiceClient.GetUser(request);
GetUser(UserName, CallSettings)
Retrieves a Merchant Center account user.
Declaration
public virtual User GetUser(UserName name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| UserName | name | Required. The name of the user to retrieve.
Format: It is also possible to retrieve the user corresponding to the caller by
using |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| User | The RPC response. |
Sample code
// Create client
UserServiceClient userServiceClient = UserServiceClient.Create();
// Initialize request argument(s)
UserName name = UserName.FromAccountEmail("[ACCOUNT]", "[EMAIL]");
// Make the request
User response = userServiceClient.GetUser(name);
GetUser(string, CallSettings)
Retrieves a Merchant Center account user.
Declaration
public virtual User GetUser(string name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Required. The name of the user to retrieve.
Format: It is also possible to retrieve the user corresponding to the caller by
using |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| User | The RPC response. |
Sample code
// Create client
UserServiceClient userServiceClient = UserServiceClient.Create();
// Initialize request argument(s)
string name = "accounts/[ACCOUNT]/users/[EMAIL]";
// Make the request
User response = userServiceClient.GetUser(name);
GetUserAsync(GetUserRequest, CallSettings)
Retrieves a Merchant Center account user.
Declaration
public virtual Task<User> GetUserAsync(GetUserRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| GetUserRequest | request | The request object containing all of the parameters for the API call. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<User> | A Task containing the RPC response. |
Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
GetUserRequest request = new GetUserRequest
{
UserName = UserName.FromAccountEmail("[ACCOUNT]", "[EMAIL]"),
};
// Make the request
User response = await userServiceClient.GetUserAsync(request);
GetUserAsync(GetUserRequest, CancellationToken)
Retrieves a Merchant Center account user.
Declaration
public virtual Task<User> GetUserAsync(GetUserRequest request, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| GetUserRequest | request | The request object containing all of the parameters for the API call. |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<User> | A Task containing the RPC response. |
Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
GetUserRequest request = new GetUserRequest
{
UserName = UserName.FromAccountEmail("[ACCOUNT]", "[EMAIL]"),
};
// Make the request
User response = await userServiceClient.GetUserAsync(request);
GetUserAsync(UserName, CallSettings)
Retrieves a Merchant Center account user.
Declaration
public virtual Task<User> GetUserAsync(UserName name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| UserName | name | Required. The name of the user to retrieve.
Format: It is also possible to retrieve the user corresponding to the caller by
using |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<User> | A Task containing the RPC response. |
Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
UserName name = UserName.FromAccountEmail("[ACCOUNT]", "[EMAIL]");
// Make the request
User response = await userServiceClient.GetUserAsync(name);
GetUserAsync(UserName, CancellationToken)
Retrieves a Merchant Center account user.
Declaration
public virtual Task<User> GetUserAsync(UserName name, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| UserName | name | Required. The name of the user to retrieve.
Format: It is also possible to retrieve the user corresponding to the caller by
using |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<User> | A Task containing the RPC response. |
Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
UserName name = UserName.FromAccountEmail("[ACCOUNT]", "[EMAIL]");
// Make the request
User response = await userServiceClient.GetUserAsync(name);
GetUserAsync(string, CallSettings)
Retrieves a Merchant Center account user.
Declaration
public virtual Task<User> GetUserAsync(string name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Required. The name of the user to retrieve.
Format: It is also possible to retrieve the user corresponding to the caller by
using |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<User> | A Task containing the RPC response. |
Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "accounts/[ACCOUNT]/users/[EMAIL]";
// Make the request
User response = await userServiceClient.GetUserAsync(name);
GetUserAsync(string, CancellationToken)
Retrieves a Merchant Center account user.
Declaration
public virtual Task<User> GetUserAsync(string name, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Required. The name of the user to retrieve.
Format: It is also possible to retrieve the user corresponding to the caller by
using |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<User> | A Task containing the RPC response. |
Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "accounts/[ACCOUNT]/users/[EMAIL]";
// Make the request
User response = await userServiceClient.GetUserAsync(name);
ListUsers(AccountName, string, int?, CallSettings)
Lists all users of a Merchant Center account.
Declaration
public virtual PagedEnumerable<ListUsersResponse, User> ListUsers(AccountName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| AccountName | parent | Required. The parent, which owns this collection of users.
Format: |
| string | pageToken | The token returned from the previous request. A value of |
| int? | pageSize | The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| PagedEnumerable<ListUsersResponse, User> | A pageable sequence of User resources. |
Sample code
// Create client
UserServiceClient userServiceClient = UserServiceClient.Create();
// Initialize request argument(s)
AccountName parent = AccountName.FromAccount("[ACCOUNT]");
// Make the request
PagedEnumerable<ListUsersResponse, User> response = userServiceClient.ListUsers(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (User item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListUsersResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (User item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<User> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (User item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListUsers(ListUsersRequest, CallSettings)
Lists all users of a Merchant Center account.
Declaration
public virtual PagedEnumerable<ListUsersResponse, User> ListUsers(ListUsersRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ListUsersRequest | request | The request object containing all of the parameters for the API call. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| PagedEnumerable<ListUsersResponse, User> | A pageable sequence of User resources. |
Sample code
// Create client
UserServiceClient userServiceClient = UserServiceClient.Create();
// Initialize request argument(s)
ListUsersRequest request = new ListUsersRequest
{
ParentAsAccountName = AccountName.FromAccount("[ACCOUNT]"),
};
// Make the request
PagedEnumerable<ListUsersResponse, User> response = userServiceClient.ListUsers(request);
// Iterate over all response items, lazily performing RPCs as required
foreach (User item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListUsersResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (User item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<User> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (User item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListUsers(string, string, int?, CallSettings)
Lists all users of a Merchant Center account.
Declaration
public virtual PagedEnumerable<ListUsersResponse, User> ListUsers(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | parent | Required. The parent, which owns this collection of users.
Format: |
| string | pageToken | The token returned from the previous request. A value of |
| int? | pageSize | The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| PagedEnumerable<ListUsersResponse, User> | A pageable sequence of User resources. |
Sample code
// Create client
UserServiceClient userServiceClient = UserServiceClient.Create();
// Initialize request argument(s)
string parent = "accounts/[ACCOUNT]";
// Make the request
PagedEnumerable<ListUsersResponse, User> response = userServiceClient.ListUsers(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (User item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListUsersResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (User item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<User> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (User item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListUsersAsync(AccountName, string, int?, CallSettings)
Lists all users of a Merchant Center account.
Declaration
public virtual PagedAsyncEnumerable<ListUsersResponse, User> ListUsersAsync(AccountName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| AccountName | parent | Required. The parent, which owns this collection of users.
Format: |
| string | pageToken | The token returned from the previous request. A value of |
| int? | pageSize | The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| PagedAsyncEnumerable<ListUsersResponse, User> | A pageable asynchronous sequence of User resources. |
Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
AccountName parent = AccountName.FromAccount("[ACCOUNT]");
// Make the request
PagedAsyncEnumerable<ListUsersResponse, User> response = userServiceClient.ListUsersAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((User item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListUsersResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (User item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<User> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (User item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListUsersAsync(ListUsersRequest, CallSettings)
Lists all users of a Merchant Center account.
Declaration
public virtual PagedAsyncEnumerable<ListUsersResponse, User> ListUsersAsync(ListUsersRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ListUsersRequest | request | The request object containing all of the parameters for the API call. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| PagedAsyncEnumerable<ListUsersResponse, User> | A pageable asynchronous sequence of User resources. |
Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
ListUsersRequest request = new ListUsersRequest
{
ParentAsAccountName = AccountName.FromAccount("[ACCOUNT]"),
};
// Make the request
PagedAsyncEnumerable<ListUsersResponse, User> response = userServiceClient.ListUsersAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((User item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListUsersResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (User item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<User> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (User item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListUsersAsync(string, string, int?, CallSettings)
Lists all users of a Merchant Center account.
Declaration
public virtual PagedAsyncEnumerable<ListUsersResponse, User> ListUsersAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | parent | Required. The parent, which owns this collection of users.
Format: |
| string | pageToken | The token returned from the previous request. A value of |
| int? | pageSize | The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| PagedAsyncEnumerable<ListUsersResponse, User> | A pageable asynchronous sequence of User resources. |
Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "accounts/[ACCOUNT]";
// Make the request
PagedAsyncEnumerable<ListUsersResponse, User> response = userServiceClient.ListUsersAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((User item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListUsersResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (User item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<User> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (User item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ShutdownDefaultChannelsAsync()
Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.
Declaration
public static Task ShutdownDefaultChannelsAsync()
Returns
| Type | Description |
|---|---|
| Task | A task representing the asynchronous shutdown operation. |
Remarks
After calling this method, further calls to Create() and CreateAsync(CancellationToken) will create new channels, which could in turn be shut down by another call to this method.
UpdateUser(UpdateUserRequest, CallSettings)
Updates a Merchant Center account user. Executing this method requires admin access.
Declaration
public virtual User UpdateUser(UpdateUserRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| UpdateUserRequest | request | The request object containing all of the parameters for the API call. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| User | The RPC response. |
Sample code
// Create client
UserServiceClient userServiceClient = UserServiceClient.Create();
// Initialize request argument(s)
UpdateUserRequest request = new UpdateUserRequest
{
User = new User(),
UpdateMask = new FieldMask(),
};
// Make the request
User response = userServiceClient.UpdateUser(request);
UpdateUser(User, FieldMask, CallSettings)
Updates a Merchant Center account user. Executing this method requires admin access.
Declaration
public virtual User UpdateUser(User user, FieldMask updateMask, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| User | user | Required. The new version of the user. Use |
| FieldMask | updateMask | Required. List of fields being updated. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| User | The RPC response. |
Sample code
// Create client
UserServiceClient userServiceClient = UserServiceClient.Create();
// Initialize request argument(s)
User user = new User();
FieldMask updateMask = new FieldMask();
// Make the request
User response = userServiceClient.UpdateUser(user, updateMask);
UpdateUserAsync(UpdateUserRequest, CallSettings)
Updates a Merchant Center account user. Executing this method requires admin access.
Declaration
public virtual Task<User> UpdateUserAsync(UpdateUserRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| UpdateUserRequest | request | The request object containing all of the parameters for the API call. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<User> | A Task containing the RPC response. |
Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateUserRequest request = new UpdateUserRequest
{
User = new User(),
UpdateMask = new FieldMask(),
};
// Make the request
User response = await userServiceClient.UpdateUserAsync(request);
UpdateUserAsync(UpdateUserRequest, CancellationToken)
Updates a Merchant Center account user. Executing this method requires admin access.
Declaration
public virtual Task<User> UpdateUserAsync(UpdateUserRequest request, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| UpdateUserRequest | request | The request object containing all of the parameters for the API call. |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<User> | A Task containing the RPC response. |
Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateUserRequest request = new UpdateUserRequest
{
User = new User(),
UpdateMask = new FieldMask(),
};
// Make the request
User response = await userServiceClient.UpdateUserAsync(request);
UpdateUserAsync(User, FieldMask, CallSettings)
Updates a Merchant Center account user. Executing this method requires admin access.
Declaration
public virtual Task<User> UpdateUserAsync(User user, FieldMask updateMask, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| User | user | Required. The new version of the user. Use |
| FieldMask | updateMask | Required. List of fields being updated. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<User> | A Task containing the RPC response. |
Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
User user = new User();
FieldMask updateMask = new FieldMask();
// Make the request
User response = await userServiceClient.UpdateUserAsync(user, updateMask);
UpdateUserAsync(User, FieldMask, CancellationToken)
Updates a Merchant Center account user. Executing this method requires admin access.
Declaration
public virtual Task<User> UpdateUserAsync(User user, FieldMask updateMask, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| User | user | Required. The new version of the user. Use |
| FieldMask | updateMask | Required. List of fields being updated. |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<User> | A Task containing the RPC response. |
Sample code
// Create client
UserServiceClient userServiceClient = await UserServiceClient.CreateAsync();
// Initialize request argument(s)
User user = new User();
FieldMask updateMask = new FieldMask();
// Make the request
User response = await userServiceClient.UpdateUserAsync(user, updateMask);