Show / Hide Table of Contents

Class UserServiceClient

UserService client wrapper, for convenient use.

Inheritance
object
UserServiceClient
UserServiceClientImpl
Inherited Members
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ToString()
Namespace: Google.Shopping.Merchant.Accounts.V1
Assembly: Google.Shopping.Merchant.Accounts.V1.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, string, CallSettings)

Creates a Merchant Center account user. Executing this method requires admin access.

Declaration
public virtual User CreateUser(AccountName parent, User user, string userId, CallSettings callSettings = null)
Parameters
Type Name Description
AccountName parent

Required. The resource name of the account for which a user will be created. Format: accounts/{account}

User user

Optional. The user to create.

string userId

Required. The email address of the user (for example, john.doe@gmail.com).

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();
string userId = "";
// Make the request
User response = userServiceClient.CreateUser(parent, user, userId);

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, string, CallSettings)

Creates a Merchant Center account user. Executing this method requires admin access.

Declaration
public virtual User CreateUser(string parent, User user, string userId, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. The resource name of the account for which a user will be created. Format: accounts/{account}

User user

Optional. The user to create.

string userId

Required. The email address of the user (for example, john.doe@gmail.com).

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();
string userId = "";
// Make the request
User response = userServiceClient.CreateUser(parent, user, userId);

CreateUserAsync(AccountName, User, string, CallSettings)

Creates a Merchant Center account user. Executing this method requires admin access.

Declaration
public virtual Task<User> CreateUserAsync(AccountName parent, User user, string userId, CallSettings callSettings = null)
Parameters
Type Name Description
AccountName parent

Required. The resource name of the account for which a user will be created. Format: accounts/{account}

User user

Optional. The user to create.

string userId

Required. The email address of the user (for example, john.doe@gmail.com).

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();
string userId = "";
// Make the request
User response = await userServiceClient.CreateUserAsync(parent, user, userId);

CreateUserAsync(AccountName, User, string, CancellationToken)

Creates a Merchant Center account user. Executing this method requires admin access.

Declaration
public virtual Task<User> CreateUserAsync(AccountName parent, User user, string userId, CancellationToken cancellationToken)
Parameters
Type Name Description
AccountName parent

Required. The resource name of the account for which a user will be created. Format: accounts/{account}

User user

Optional. The user to create.

string userId

Required. The email address of the user (for example, john.doe@gmail.com).

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();
string userId = "";
// Make the request
User response = await userServiceClient.CreateUserAsync(parent, user, userId);

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, string, CallSettings)

Creates a Merchant Center account user. Executing this method requires admin access.

Declaration
public virtual Task<User> CreateUserAsync(string parent, User user, string userId, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. The resource name of the account for which a user will be created. Format: accounts/{account}

User user

Optional. The user to create.

string userId

Required. The email address of the user (for example, john.doe@gmail.com).

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();
string userId = "";
// Make the request
User response = await userServiceClient.CreateUserAsync(parent, user, userId);

CreateUserAsync(string, User, string, CancellationToken)

Creates a Merchant Center account user. Executing this method requires admin access.

Declaration
public virtual Task<User> CreateUserAsync(string parent, User user, string userId, CancellationToken cancellationToken)
Parameters
Type Name Description
string parent

Required. The resource name of the account for which a user will be created. Format: accounts/{account}

User user

Optional. The user to create.

string userId

Required. The email address of the user (for example, john.doe@gmail.com).

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();
string userId = "";
// Make the request
User response = await userServiceClient.CreateUserAsync(parent, user, userId);

DeleteUser(DeleteUserRequest, CallSettings)

Deletes a Merchant Center account user. Executing this method requires admin access. The user to be deleted can't be the last admin user of that account. Also a user is protected from deletion if it is managed by Business Manager"

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. The user to be deleted can't be the last admin user of that account. Also a user is protected from deletion if it is managed by Business Manager"

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: accounts/{account}/users/{email}

It is also possible to delete the user corresponding to the caller by using me rather than an email address as in accounts/{account}/users/me.

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. The user to be deleted can't be the last admin user of that account. Also a user is protected from deletion if it is managed by Business Manager"

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: accounts/{account}/users/{email}

It is also possible to delete the user corresponding to the caller by using me rather than an email address as in accounts/{account}/users/me.

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. The user to be deleted can't be the last admin user of that account. Also a user is protected from deletion if it is managed by Business Manager"

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. The user to be deleted can't be the last admin user of that account. Also a user is protected from deletion if it is managed by Business Manager"

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. The user to be deleted can't be the last admin user of that account. Also a user is protected from deletion if it is managed by Business Manager"

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: accounts/{account}/users/{email}

It is also possible to delete the user corresponding to the caller by using me rather than an email address as in accounts/{account}/users/me.

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. The user to be deleted can't be the last admin user of that account. Also a user is protected from deletion if it is managed by Business Manager"

Declaration
public virtual Task DeleteUserAsync(UserName name, CancellationToken cancellationToken)
Parameters
Type Name Description
UserName name

Required. The name of the user to delete. Format: accounts/{account}/users/{email}

It is also possible to delete the user corresponding to the caller by using me rather than an email address as in accounts/{account}/users/me.

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. The user to be deleted can't be the last admin user of that account. Also a user is protected from deletion if it is managed by Business Manager"

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: accounts/{account}/users/{email}

It is also possible to delete the user corresponding to the caller by using me rather than an email address as in accounts/{account}/users/me.

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. The user to be deleted can't be the last admin user of that account. Also a user is protected from deletion if it is managed by Business Manager"

Declaration
public virtual Task DeleteUserAsync(string name, CancellationToken cancellationToken)
Parameters
Type Name Description
string name

Required. The name of the user to delete. Format: accounts/{account}/users/{email}

It is also possible to delete the user corresponding to the caller by using me rather than an email address as in accounts/{account}/users/me.

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: accounts/{account}/users/{email}

It is also possible to retrieve the user corresponding to the caller by using me rather than an email address as in accounts/{account}/users/me.

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: accounts/{account}/users/{email}

It is also possible to retrieve the user corresponding to the caller by using me rather than an email address as in accounts/{account}/users/me.

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: accounts/{account}/users/{email}

It is also possible to retrieve the user corresponding to the caller by using me rather than an email address as in accounts/{account}/users/me.

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: accounts/{account}/users/{email}

It is also possible to retrieve the user corresponding to the caller by using me rather than an email address as in accounts/{account}/users/me.

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: accounts/{account}/users/{email}

It is also possible to retrieve the user corresponding to the caller by using me rather than an email address as in accounts/{account}/users/me.

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: accounts/{account}/users/{email}

It is also possible to retrieve the user corresponding to the caller by using me rather than an email address as in accounts/{account}/users/me.

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: accounts/{account}

string pageToken

The token returned from the previous request. A value of null or an empty string retrieves the first page.

int? pageSize

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

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: accounts/{account}

string pageToken

The token returned from the previous request. A value of null or an empty string retrieves the first page.

int? pageSize

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

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: accounts/{account}

string pageToken

The token returned from the previous request. A value of null or an empty string retrieves the first page.

int? pageSize

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

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: accounts/{account}

string pageToken

The token returned from the previous request. A value of null or an empty string retrieves the first page.

int? pageSize

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

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 me to refer to your own email address, for example accounts/{account}/users/me.

FieldMask updateMask

Optional. List of fields being updated.

The following fields are supported (in both snake_case and lowerCamelCase):

  • access_rights
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 me to refer to your own email address, for example accounts/{account}/users/me.

FieldMask updateMask

Optional. List of fields being updated.

The following fields are supported (in both snake_case and lowerCamelCase):

  • access_rights
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 me to refer to your own email address, for example accounts/{account}/users/me.

FieldMask updateMask

Optional. List of fields being updated.

The following fields are supported (in both snake_case and lowerCamelCase):

  • access_rights
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);
In this article
Back to top Generated by DocFX