Show / Hide Table of Contents

Class HomepageServiceClient

HomepageService client wrapper, for convenient use.

Inheritance
object
HomepageServiceClient
HomepageServiceClientImpl
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 HomepageServiceClient
Remarks

Service to support an API for a store's homepage.

Properties

DefaultEndpoint

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

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

The default HomepageService scopes are:

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

GrpcClient

The underlying gRPC HomepageService client

Declaration
public virtual HomepageService.HomepageServiceClient GrpcClient { get; }
Property Value
Type Description
HomepageService.HomepageServiceClient

ServiceMetadata

The service metadata associated with this client type.

Declaration
public static ServiceMetadata ServiceMetadata { get; }
Property Value
Type Description
ServiceMetadata

Methods

ClaimHomepage(ClaimHomepageRequest, CallSettings)

Claims a store's homepage. Executing this method requires admin access.

If the homepage is already claimed, this will recheck the verification (unless the business is exempted from claiming, which also exempts from verification) and return a successful response. If ownership can no longer be verified, it will return an error, but it won't clear the claim.

In case of failure, a canonical error message is returned:

  • PERMISSION_DENIED: User doesn't have the necessary permissions on this Merchant Center account.

  • FAILED_PRECONDITION:

  • The account is not a Merchant Center account.

  • Merchant Center account doesn't have a homepage.

  • Claiming failed (in this case the error message contains more details).

Declaration
public virtual Homepage ClaimHomepage(ClaimHomepageRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
ClaimHomepageRequest 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
Homepage

The RPC response.

Sample code
// Create client
HomepageServiceClient homepageServiceClient = HomepageServiceClient.Create();
// Initialize request argument(s)
ClaimHomepageRequest request = new ClaimHomepageRequest
{
    HomepageName = HomepageName.FromAccount("[ACCOUNT]"),
    Overwrite = false,
};
// Make the request
Homepage response = homepageServiceClient.ClaimHomepage(request);

ClaimHomepageAsync(ClaimHomepageRequest, CallSettings)

Claims a store's homepage. Executing this method requires admin access.

If the homepage is already claimed, this will recheck the verification (unless the business is exempted from claiming, which also exempts from verification) and return a successful response. If ownership can no longer be verified, it will return an error, but it won't clear the claim.

In case of failure, a canonical error message is returned:

  • PERMISSION_DENIED: User doesn't have the necessary permissions on this Merchant Center account.

  • FAILED_PRECONDITION:

  • The account is not a Merchant Center account.

  • Merchant Center account doesn't have a homepage.

  • Claiming failed (in this case the error message contains more details).

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

A Task containing the RPC response.

Sample code
// Create client
HomepageServiceClient homepageServiceClient = await HomepageServiceClient.CreateAsync();
// Initialize request argument(s)
ClaimHomepageRequest request = new ClaimHomepageRequest
{
    HomepageName = HomepageName.FromAccount("[ACCOUNT]"),
    Overwrite = false,
};
// Make the request
Homepage response = await homepageServiceClient.ClaimHomepageAsync(request);

ClaimHomepageAsync(ClaimHomepageRequest, CancellationToken)

Claims a store's homepage. Executing this method requires admin access.

If the homepage is already claimed, this will recheck the verification (unless the business is exempted from claiming, which also exempts from verification) and return a successful response. If ownership can no longer be verified, it will return an error, but it won't clear the claim.

In case of failure, a canonical error message is returned:

  • PERMISSION_DENIED: User doesn't have the necessary permissions on this Merchant Center account.

  • FAILED_PRECONDITION:

  • The account is not a Merchant Center account.

  • Merchant Center account doesn't have a homepage.

  • Claiming failed (in this case the error message contains more details).

Declaration
public virtual Task<Homepage> ClaimHomepageAsync(ClaimHomepageRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
ClaimHomepageRequest 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<Homepage>

A Task containing the RPC response.

Sample code
// Create client
HomepageServiceClient homepageServiceClient = await HomepageServiceClient.CreateAsync();
// Initialize request argument(s)
ClaimHomepageRequest request = new ClaimHomepageRequest
{
    HomepageName = HomepageName.FromAccount("[ACCOUNT]"),
    Overwrite = false,
};
// Make the request
Homepage response = await homepageServiceClient.ClaimHomepageAsync(request);

Create()

Synchronously creates a HomepageServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use HomepageServiceClientBuilder.

Declaration
public static HomepageServiceClient Create()
Returns
Type Description
HomepageServiceClient

The created HomepageServiceClient.

CreateAsync(CancellationToken)

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

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

The CancellationToken to use while creating the client.

Returns
Type Description
Task<HomepageServiceClient>

The task representing the created HomepageServiceClient.

GetHomepage(GetHomepageRequest, CallSettings)

Retrieves a store's homepage.

Declaration
public virtual Homepage GetHomepage(GetHomepageRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
GetHomepageRequest 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
Homepage

The RPC response.

Sample code
// Create client
HomepageServiceClient homepageServiceClient = HomepageServiceClient.Create();
// Initialize request argument(s)
GetHomepageRequest request = new GetHomepageRequest
{
    HomepageName = HomepageName.FromAccount("[ACCOUNT]"),
};
// Make the request
Homepage response = homepageServiceClient.GetHomepage(request);

GetHomepage(HomepageName, CallSettings)

Retrieves a store's homepage.

Declaration
public virtual Homepage GetHomepage(HomepageName name, CallSettings callSettings = null)
Parameters
Type Name Description
HomepageName name

Required. The name of the homepage to retrieve. Format: accounts/{account}/homepage

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Homepage

The RPC response.

Sample code
// Create client
HomepageServiceClient homepageServiceClient = HomepageServiceClient.Create();
// Initialize request argument(s)
HomepageName name = HomepageName.FromAccount("[ACCOUNT]");
// Make the request
Homepage response = homepageServiceClient.GetHomepage(name);

GetHomepage(string, CallSettings)

Retrieves a store's homepage.

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

Required. The name of the homepage to retrieve. Format: accounts/{account}/homepage

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Homepage

The RPC response.

Sample code
// Create client
HomepageServiceClient homepageServiceClient = HomepageServiceClient.Create();
// Initialize request argument(s)
string name = "accounts/[ACCOUNT]/homepage";
// Make the request
Homepage response = homepageServiceClient.GetHomepage(name);

GetHomepageAsync(GetHomepageRequest, CallSettings)

Retrieves a store's homepage.

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

A Task containing the RPC response.

Sample code
// Create client
HomepageServiceClient homepageServiceClient = await HomepageServiceClient.CreateAsync();
// Initialize request argument(s)
GetHomepageRequest request = new GetHomepageRequest
{
    HomepageName = HomepageName.FromAccount("[ACCOUNT]"),
};
// Make the request
Homepage response = await homepageServiceClient.GetHomepageAsync(request);

GetHomepageAsync(GetHomepageRequest, CancellationToken)

Retrieves a store's homepage.

Declaration
public virtual Task<Homepage> GetHomepageAsync(GetHomepageRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
GetHomepageRequest 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<Homepage>

A Task containing the RPC response.

Sample code
// Create client
HomepageServiceClient homepageServiceClient = await HomepageServiceClient.CreateAsync();
// Initialize request argument(s)
GetHomepageRequest request = new GetHomepageRequest
{
    HomepageName = HomepageName.FromAccount("[ACCOUNT]"),
};
// Make the request
Homepage response = await homepageServiceClient.GetHomepageAsync(request);

GetHomepageAsync(HomepageName, CallSettings)

Retrieves a store's homepage.

Declaration
public virtual Task<Homepage> GetHomepageAsync(HomepageName name, CallSettings callSettings = null)
Parameters
Type Name Description
HomepageName name

Required. The name of the homepage to retrieve. Format: accounts/{account}/homepage

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Homepage>

A Task containing the RPC response.

Sample code
// Create client
HomepageServiceClient homepageServiceClient = await HomepageServiceClient.CreateAsync();
// Initialize request argument(s)
HomepageName name = HomepageName.FromAccount("[ACCOUNT]");
// Make the request
Homepage response = await homepageServiceClient.GetHomepageAsync(name);

GetHomepageAsync(HomepageName, CancellationToken)

Retrieves a store's homepage.

Declaration
public virtual Task<Homepage> GetHomepageAsync(HomepageName name, CancellationToken cancellationToken)
Parameters
Type Name Description
HomepageName name

Required. The name of the homepage to retrieve. Format: accounts/{account}/homepage

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Homepage>

A Task containing the RPC response.

Sample code
// Create client
HomepageServiceClient homepageServiceClient = await HomepageServiceClient.CreateAsync();
// Initialize request argument(s)
HomepageName name = HomepageName.FromAccount("[ACCOUNT]");
// Make the request
Homepage response = await homepageServiceClient.GetHomepageAsync(name);

GetHomepageAsync(string, CallSettings)

Retrieves a store's homepage.

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

Required. The name of the homepage to retrieve. Format: accounts/{account}/homepage

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Homepage>

A Task containing the RPC response.

Sample code
// Create client
HomepageServiceClient homepageServiceClient = await HomepageServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "accounts/[ACCOUNT]/homepage";
// Make the request
Homepage response = await homepageServiceClient.GetHomepageAsync(name);

GetHomepageAsync(string, CancellationToken)

Retrieves a store's homepage.

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

Required. The name of the homepage to retrieve. Format: accounts/{account}/homepage

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Homepage>

A Task containing the RPC response.

Sample code
// Create client
HomepageServiceClient homepageServiceClient = await HomepageServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "accounts/[ACCOUNT]/homepage";
// Make the request
Homepage response = await homepageServiceClient.GetHomepageAsync(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.

UnclaimHomepage(UnclaimHomepageRequest, CallSettings)

Unclaims a store's homepage. Executing this method requires admin access.

Declaration
public virtual Homepage UnclaimHomepage(UnclaimHomepageRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
UnclaimHomepageRequest 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
Homepage

The RPC response.

Sample code
// Create client
HomepageServiceClient homepageServiceClient = HomepageServiceClient.Create();
// Initialize request argument(s)
UnclaimHomepageRequest request = new UnclaimHomepageRequest
{
    HomepageName = HomepageName.FromAccount("[ACCOUNT]"),
};
// Make the request
Homepage response = homepageServiceClient.UnclaimHomepage(request);

UnclaimHomepageAsync(UnclaimHomepageRequest, CallSettings)

Unclaims a store's homepage. Executing this method requires admin access.

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

A Task containing the RPC response.

Sample code
// Create client
HomepageServiceClient homepageServiceClient = await HomepageServiceClient.CreateAsync();
// Initialize request argument(s)
UnclaimHomepageRequest request = new UnclaimHomepageRequest
{
    HomepageName = HomepageName.FromAccount("[ACCOUNT]"),
};
// Make the request
Homepage response = await homepageServiceClient.UnclaimHomepageAsync(request);

UnclaimHomepageAsync(UnclaimHomepageRequest, CancellationToken)

Unclaims a store's homepage. Executing this method requires admin access.

Declaration
public virtual Task<Homepage> UnclaimHomepageAsync(UnclaimHomepageRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
UnclaimHomepageRequest 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<Homepage>

A Task containing the RPC response.

Sample code
// Create client
HomepageServiceClient homepageServiceClient = await HomepageServiceClient.CreateAsync();
// Initialize request argument(s)
UnclaimHomepageRequest request = new UnclaimHomepageRequest
{
    HomepageName = HomepageName.FromAccount("[ACCOUNT]"),
};
// Make the request
Homepage response = await homepageServiceClient.UnclaimHomepageAsync(request);

UpdateHomepage(Homepage, FieldMask, CallSettings)

Updates a store's homepage. Executing this method requires admin access.

Declaration
public virtual Homepage UpdateHomepage(Homepage homepage, FieldMask updateMask, CallSettings callSettings = null)
Parameters
Type Name Description
Homepage homepage

Required. The new version of the homepage.

FieldMask updateMask

Optional. List of fields being updated.

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

  • uri
CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Homepage

The RPC response.

Sample code
// Create client
HomepageServiceClient homepageServiceClient = HomepageServiceClient.Create();
// Initialize request argument(s)
Homepage homepage = new Homepage();
FieldMask updateMask = new FieldMask();
// Make the request
Homepage response = homepageServiceClient.UpdateHomepage(homepage, updateMask);

UpdateHomepage(UpdateHomepageRequest, CallSettings)

Updates a store's homepage. Executing this method requires admin access.

Declaration
public virtual Homepage UpdateHomepage(UpdateHomepageRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
UpdateHomepageRequest 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
Homepage

The RPC response.

Sample code
// Create client
HomepageServiceClient homepageServiceClient = HomepageServiceClient.Create();
// Initialize request argument(s)
UpdateHomepageRequest request = new UpdateHomepageRequest
{
    Homepage = new Homepage(),
    UpdateMask = new FieldMask(),
};
// Make the request
Homepage response = homepageServiceClient.UpdateHomepage(request);

UpdateHomepageAsync(Homepage, FieldMask, CallSettings)

Updates a store's homepage. Executing this method requires admin access.

Declaration
public virtual Task<Homepage> UpdateHomepageAsync(Homepage homepage, FieldMask updateMask, CallSettings callSettings = null)
Parameters
Type Name Description
Homepage homepage

Required. The new version of the homepage.

FieldMask updateMask

Optional. List of fields being updated.

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

  • uri
CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<Homepage>

A Task containing the RPC response.

Sample code
// Create client
HomepageServiceClient homepageServiceClient = await HomepageServiceClient.CreateAsync();
// Initialize request argument(s)
Homepage homepage = new Homepage();
FieldMask updateMask = new FieldMask();
// Make the request
Homepage response = await homepageServiceClient.UpdateHomepageAsync(homepage, updateMask);

UpdateHomepageAsync(Homepage, FieldMask, CancellationToken)

Updates a store's homepage. Executing this method requires admin access.

Declaration
public virtual Task<Homepage> UpdateHomepageAsync(Homepage homepage, FieldMask updateMask, CancellationToken cancellationToken)
Parameters
Type Name Description
Homepage homepage

Required. The new version of the homepage.

FieldMask updateMask

Optional. List of fields being updated.

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

  • uri
CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Homepage>

A Task containing the RPC response.

Sample code
// Create client
HomepageServiceClient homepageServiceClient = await HomepageServiceClient.CreateAsync();
// Initialize request argument(s)
Homepage homepage = new Homepage();
FieldMask updateMask = new FieldMask();
// Make the request
Homepage response = await homepageServiceClient.UpdateHomepageAsync(homepage, updateMask);

UpdateHomepageAsync(UpdateHomepageRequest, CallSettings)

Updates a store's homepage. Executing this method requires admin access.

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

A Task containing the RPC response.

Sample code
// Create client
HomepageServiceClient homepageServiceClient = await HomepageServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateHomepageRequest request = new UpdateHomepageRequest
{
    Homepage = new Homepage(),
    UpdateMask = new FieldMask(),
};
// Make the request
Homepage response = await homepageServiceClient.UpdateHomepageAsync(request);

UpdateHomepageAsync(UpdateHomepageRequest, CancellationToken)

Updates a store's homepage. Executing this method requires admin access.

Declaration
public virtual Task<Homepage> UpdateHomepageAsync(UpdateHomepageRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
UpdateHomepageRequest 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<Homepage>

A Task containing the RPC response.

Sample code
// Create client
HomepageServiceClient homepageServiceClient = await HomepageServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateHomepageRequest request = new UpdateHomepageRequest
{
    Homepage = new Homepage(),
    UpdateMask = new FieldMask(),
};
// Make the request
Homepage response = await homepageServiceClient.UpdateHomepageAsync(request);
In this article
Back to top Generated by DocFX