Show / Hide Table of Contents

Class EmailPreferencesServiceClient

EmailPreferencesService client wrapper, for convenient use.

Inheritance
object
EmailPreferencesServiceClient
EmailPreferencesServiceClientImpl
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 EmailPreferencesServiceClient
Remarks

Service to support the EmailPreferences API.

Properties

DefaultEndpoint

The default endpoint for the EmailPreferencesService 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 EmailPreferencesService scopes.

Declaration
public static IReadOnlyList<string> DefaultScopes { get; }
Property Value
Type Description
IReadOnlyList<string>
Remarks

The default EmailPreferencesService scopes are:

  • https://www.googleapis.com/auth/content

GrpcClient

The underlying gRPC EmailPreferencesService client

Declaration
public virtual EmailPreferencesService.EmailPreferencesServiceClient GrpcClient { get; }
Property Value
Type Description
EmailPreferencesService.EmailPreferencesServiceClient

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 EmailPreferencesServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use EmailPreferencesServiceClientBuilder.

Declaration
public static EmailPreferencesServiceClient Create()
Returns
Type Description
EmailPreferencesServiceClient

The created EmailPreferencesServiceClient.

CreateAsync(CancellationToken)

Asynchronously creates a EmailPreferencesServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use EmailPreferencesServiceClientBuilder.

Declaration
public static Task<EmailPreferencesServiceClient> CreateAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
Task<EmailPreferencesServiceClient>

The task representing the created EmailPreferencesServiceClient.

GetEmailPreferences(EmailPreferencesName, CallSettings)

Returns the email preferences for a Merchant Center account user. This service only permits retrieving and updating email preferences for the authenticated user. Use the name=accounts/*/users/me/emailPreferences alias to get preferences for the authenticated user.

Declaration
public virtual EmailPreferences GetEmailPreferences(EmailPreferencesName name, CallSettings callSettings = null)
Parameters
Type Name Description
EmailPreferencesName name

Required. The name of the EmailPreferences resource. Format: accounts/{account}/users/{email}/emailPreferences

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
EmailPreferences

The RPC response.

Sample code
// Create client
EmailPreferencesServiceClient emailPreferencesServiceClient = EmailPreferencesServiceClient.Create();
// Initialize request argument(s)
EmailPreferencesName name = EmailPreferencesName.FromAccountEmail("[ACCOUNT]", "[EMAIL]");
// Make the request
EmailPreferences response = emailPreferencesServiceClient.GetEmailPreferences(name);

GetEmailPreferences(GetEmailPreferencesRequest, CallSettings)

Returns the email preferences for a Merchant Center account user. This service only permits retrieving and updating email preferences for the authenticated user. Use the name=accounts/*/users/me/emailPreferences alias to get preferences for the authenticated user.

Declaration
public virtual EmailPreferences GetEmailPreferences(GetEmailPreferencesRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
GetEmailPreferencesRequest 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
EmailPreferences

The RPC response.

Sample code
// Create client
EmailPreferencesServiceClient emailPreferencesServiceClient = EmailPreferencesServiceClient.Create();
// Initialize request argument(s)
GetEmailPreferencesRequest request = new GetEmailPreferencesRequest
{
    EmailPreferencesName = EmailPreferencesName.FromAccountEmail("[ACCOUNT]", "[EMAIL]"),
};
// Make the request
EmailPreferences response = emailPreferencesServiceClient.GetEmailPreferences(request);

GetEmailPreferences(string, CallSettings)

Returns the email preferences for a Merchant Center account user. This service only permits retrieving and updating email preferences for the authenticated user. Use the name=accounts/*/users/me/emailPreferences alias to get preferences for the authenticated user.

Declaration
public virtual EmailPreferences GetEmailPreferences(string name, CallSettings callSettings = null)
Parameters
Type Name Description
string name

Required. The name of the EmailPreferences resource. Format: accounts/{account}/users/{email}/emailPreferences

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
EmailPreferences

The RPC response.

Sample code
// Create client
EmailPreferencesServiceClient emailPreferencesServiceClient = EmailPreferencesServiceClient.Create();
// Initialize request argument(s)
string name = "accounts/[ACCOUNT]/users/[EMAIL]/emailPreferences";
// Make the request
EmailPreferences response = emailPreferencesServiceClient.GetEmailPreferences(name);

GetEmailPreferencesAsync(EmailPreferencesName, CallSettings)

Returns the email preferences for a Merchant Center account user. This service only permits retrieving and updating email preferences for the authenticated user. Use the name=accounts/*/users/me/emailPreferences alias to get preferences for the authenticated user.

Declaration
public virtual Task<EmailPreferences> GetEmailPreferencesAsync(EmailPreferencesName name, CallSettings callSettings = null)
Parameters
Type Name Description
EmailPreferencesName name

Required. The name of the EmailPreferences resource. Format: accounts/{account}/users/{email}/emailPreferences

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<EmailPreferences>

A Task containing the RPC response.

Sample code
// Create client
EmailPreferencesServiceClient emailPreferencesServiceClient = await EmailPreferencesServiceClient.CreateAsync();
// Initialize request argument(s)
EmailPreferencesName name = EmailPreferencesName.FromAccountEmail("[ACCOUNT]", "[EMAIL]");
// Make the request
EmailPreferences response = await emailPreferencesServiceClient.GetEmailPreferencesAsync(name);

GetEmailPreferencesAsync(EmailPreferencesName, CancellationToken)

Returns the email preferences for a Merchant Center account user. This service only permits retrieving and updating email preferences for the authenticated user. Use the name=accounts/*/users/me/emailPreferences alias to get preferences for the authenticated user.

Declaration
public virtual Task<EmailPreferences> GetEmailPreferencesAsync(EmailPreferencesName name, CancellationToken cancellationToken)
Parameters
Type Name Description
EmailPreferencesName name

Required. The name of the EmailPreferences resource. Format: accounts/{account}/users/{email}/emailPreferences

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<EmailPreferences>

A Task containing the RPC response.

Sample code
// Create client
EmailPreferencesServiceClient emailPreferencesServiceClient = await EmailPreferencesServiceClient.CreateAsync();
// Initialize request argument(s)
EmailPreferencesName name = EmailPreferencesName.FromAccountEmail("[ACCOUNT]", "[EMAIL]");
// Make the request
EmailPreferences response = await emailPreferencesServiceClient.GetEmailPreferencesAsync(name);

GetEmailPreferencesAsync(GetEmailPreferencesRequest, CallSettings)

Returns the email preferences for a Merchant Center account user. This service only permits retrieving and updating email preferences for the authenticated user. Use the name=accounts/*/users/me/emailPreferences alias to get preferences for the authenticated user.

Declaration
public virtual Task<EmailPreferences> GetEmailPreferencesAsync(GetEmailPreferencesRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
GetEmailPreferencesRequest 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<EmailPreferences>

A Task containing the RPC response.

Sample code
// Create client
EmailPreferencesServiceClient emailPreferencesServiceClient = await EmailPreferencesServiceClient.CreateAsync();
// Initialize request argument(s)
GetEmailPreferencesRequest request = new GetEmailPreferencesRequest
{
    EmailPreferencesName = EmailPreferencesName.FromAccountEmail("[ACCOUNT]", "[EMAIL]"),
};
// Make the request
EmailPreferences response = await emailPreferencesServiceClient.GetEmailPreferencesAsync(request);

GetEmailPreferencesAsync(GetEmailPreferencesRequest, CancellationToken)

Returns the email preferences for a Merchant Center account user. This service only permits retrieving and updating email preferences for the authenticated user. Use the name=accounts/*/users/me/emailPreferences alias to get preferences for the authenticated user.

Declaration
public virtual Task<EmailPreferences> GetEmailPreferencesAsync(GetEmailPreferencesRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
GetEmailPreferencesRequest 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<EmailPreferences>

A Task containing the RPC response.

Sample code
// Create client
EmailPreferencesServiceClient emailPreferencesServiceClient = await EmailPreferencesServiceClient.CreateAsync();
// Initialize request argument(s)
GetEmailPreferencesRequest request = new GetEmailPreferencesRequest
{
    EmailPreferencesName = EmailPreferencesName.FromAccountEmail("[ACCOUNT]", "[EMAIL]"),
};
// Make the request
EmailPreferences response = await emailPreferencesServiceClient.GetEmailPreferencesAsync(request);

GetEmailPreferencesAsync(string, CallSettings)

Returns the email preferences for a Merchant Center account user. This service only permits retrieving and updating email preferences for the authenticated user. Use the name=accounts/*/users/me/emailPreferences alias to get preferences for the authenticated user.

Declaration
public virtual Task<EmailPreferences> GetEmailPreferencesAsync(string name, CallSettings callSettings = null)
Parameters
Type Name Description
string name

Required. The name of the EmailPreferences resource. Format: accounts/{account}/users/{email}/emailPreferences

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<EmailPreferences>

A Task containing the RPC response.

Sample code
// Create client
EmailPreferencesServiceClient emailPreferencesServiceClient = await EmailPreferencesServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "accounts/[ACCOUNT]/users/[EMAIL]/emailPreferences";
// Make the request
EmailPreferences response = await emailPreferencesServiceClient.GetEmailPreferencesAsync(name);

GetEmailPreferencesAsync(string, CancellationToken)

Returns the email preferences for a Merchant Center account user. This service only permits retrieving and updating email preferences for the authenticated user. Use the name=accounts/*/users/me/emailPreferences alias to get preferences for the authenticated user.

Declaration
public virtual Task<EmailPreferences> GetEmailPreferencesAsync(string name, CancellationToken cancellationToken)
Parameters
Type Name Description
string name

Required. The name of the EmailPreferences resource. Format: accounts/{account}/users/{email}/emailPreferences

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<EmailPreferences>

A Task containing the RPC response.

Sample code
// Create client
EmailPreferencesServiceClient emailPreferencesServiceClient = await EmailPreferencesServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "accounts/[ACCOUNT]/users/[EMAIL]/emailPreferences";
// Make the request
EmailPreferences response = await emailPreferencesServiceClient.GetEmailPreferencesAsync(name);

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.

UpdateEmailPreferences(EmailPreferences, FieldMask, CallSettings)

Updates the email preferences for a Merchant Center account user. Advanced account users should specify the advanced account rather than a sub-account of the advanced account.

Preferences which are not explicitly selected in the update mask will not be updated.

It is invalid for updates to specify an UNCONFIRMED opt-in status value.

Use the name=accounts/*/users/me/emailPreferences alias to update preferences for the authenticated user.

Declaration
public virtual EmailPreferences UpdateEmailPreferences(EmailPreferences emailPreferences, FieldMask updateMask, CallSettings callSettings = null)
Parameters
Type Name Description
EmailPreferences emailPreferences

Required. Email Preferences to be updated.

FieldMask updateMask

Required. List of fields being updated.

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

  • news_and_tips
CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
EmailPreferences

The RPC response.

Sample code
// Create client
EmailPreferencesServiceClient emailPreferencesServiceClient = EmailPreferencesServiceClient.Create();
// Initialize request argument(s)
EmailPreferences emailPreferences = new EmailPreferences();
FieldMask updateMask = new FieldMask();
// Make the request
EmailPreferences response = emailPreferencesServiceClient.UpdateEmailPreferences(emailPreferences, updateMask);

UpdateEmailPreferences(UpdateEmailPreferencesRequest, CallSettings)

Updates the email preferences for a Merchant Center account user. Advanced account users should specify the advanced account rather than a sub-account of the advanced account.

Preferences which are not explicitly selected in the update mask will not be updated.

It is invalid for updates to specify an UNCONFIRMED opt-in status value.

Use the name=accounts/*/users/me/emailPreferences alias to update preferences for the authenticated user.

Declaration
public virtual EmailPreferences UpdateEmailPreferences(UpdateEmailPreferencesRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
UpdateEmailPreferencesRequest 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
EmailPreferences

The RPC response.

Sample code
// Create client
EmailPreferencesServiceClient emailPreferencesServiceClient = EmailPreferencesServiceClient.Create();
// Initialize request argument(s)
UpdateEmailPreferencesRequest request = new UpdateEmailPreferencesRequest
{
    EmailPreferences = new EmailPreferences(),
    UpdateMask = new FieldMask(),
};
// Make the request
EmailPreferences response = emailPreferencesServiceClient.UpdateEmailPreferences(request);

UpdateEmailPreferencesAsync(EmailPreferences, FieldMask, CallSettings)

Updates the email preferences for a Merchant Center account user. Advanced account users should specify the advanced account rather than a sub-account of the advanced account.

Preferences which are not explicitly selected in the update mask will not be updated.

It is invalid for updates to specify an UNCONFIRMED opt-in status value.

Use the name=accounts/*/users/me/emailPreferences alias to update preferences for the authenticated user.

Declaration
public virtual Task<EmailPreferences> UpdateEmailPreferencesAsync(EmailPreferences emailPreferences, FieldMask updateMask, CallSettings callSettings = null)
Parameters
Type Name Description
EmailPreferences emailPreferences

Required. Email Preferences to be updated.

FieldMask updateMask

Required. List of fields being updated.

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

  • news_and_tips
CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<EmailPreferences>

A Task containing the RPC response.

Sample code
// Create client
EmailPreferencesServiceClient emailPreferencesServiceClient = await EmailPreferencesServiceClient.CreateAsync();
// Initialize request argument(s)
EmailPreferences emailPreferences = new EmailPreferences();
FieldMask updateMask = new FieldMask();
// Make the request
EmailPreferences response = await emailPreferencesServiceClient.UpdateEmailPreferencesAsync(emailPreferences, updateMask);

UpdateEmailPreferencesAsync(EmailPreferences, FieldMask, CancellationToken)

Updates the email preferences for a Merchant Center account user. Advanced account users should specify the advanced account rather than a sub-account of the advanced account.

Preferences which are not explicitly selected in the update mask will not be updated.

It is invalid for updates to specify an UNCONFIRMED opt-in status value.

Use the name=accounts/*/users/me/emailPreferences alias to update preferences for the authenticated user.

Declaration
public virtual Task<EmailPreferences> UpdateEmailPreferencesAsync(EmailPreferences emailPreferences, FieldMask updateMask, CancellationToken cancellationToken)
Parameters
Type Name Description
EmailPreferences emailPreferences

Required. Email Preferences to be updated.

FieldMask updateMask

Required. List of fields being updated.

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

  • news_and_tips
CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<EmailPreferences>

A Task containing the RPC response.

Sample code
// Create client
EmailPreferencesServiceClient emailPreferencesServiceClient = await EmailPreferencesServiceClient.CreateAsync();
// Initialize request argument(s)
EmailPreferences emailPreferences = new EmailPreferences();
FieldMask updateMask = new FieldMask();
// Make the request
EmailPreferences response = await emailPreferencesServiceClient.UpdateEmailPreferencesAsync(emailPreferences, updateMask);

UpdateEmailPreferencesAsync(UpdateEmailPreferencesRequest, CallSettings)

Updates the email preferences for a Merchant Center account user. Advanced account users should specify the advanced account rather than a sub-account of the advanced account.

Preferences which are not explicitly selected in the update mask will not be updated.

It is invalid for updates to specify an UNCONFIRMED opt-in status value.

Use the name=accounts/*/users/me/emailPreferences alias to update preferences for the authenticated user.

Declaration
public virtual Task<EmailPreferences> UpdateEmailPreferencesAsync(UpdateEmailPreferencesRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
UpdateEmailPreferencesRequest 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<EmailPreferences>

A Task containing the RPC response.

Sample code
// Create client
EmailPreferencesServiceClient emailPreferencesServiceClient = await EmailPreferencesServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateEmailPreferencesRequest request = new UpdateEmailPreferencesRequest
{
    EmailPreferences = new EmailPreferences(),
    UpdateMask = new FieldMask(),
};
// Make the request
EmailPreferences response = await emailPreferencesServiceClient.UpdateEmailPreferencesAsync(request);

UpdateEmailPreferencesAsync(UpdateEmailPreferencesRequest, CancellationToken)

Updates the email preferences for a Merchant Center account user. Advanced account users should specify the advanced account rather than a sub-account of the advanced account.

Preferences which are not explicitly selected in the update mask will not be updated.

It is invalid for updates to specify an UNCONFIRMED opt-in status value.

Use the name=accounts/*/users/me/emailPreferences alias to update preferences for the authenticated user.

Declaration
public virtual Task<EmailPreferences> UpdateEmailPreferencesAsync(UpdateEmailPreferencesRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
UpdateEmailPreferencesRequest 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<EmailPreferences>

A Task containing the RPC response.

Sample code
// Create client
EmailPreferencesServiceClient emailPreferencesServiceClient = await EmailPreferencesServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateEmailPreferencesRequest request = new UpdateEmailPreferencesRequest
{
    EmailPreferences = new EmailPreferences(),
    UpdateMask = new FieldMask(),
};
// Make the request
EmailPreferences response = await emailPreferencesServiceClient.UpdateEmailPreferencesAsync(request);
In this article
Back to top Generated by DocFX