Class LoyaltyCustomerMatchServiceClient
LoyaltyCustomerMatchService client wrapper, for convenient use.
Namespace: Google.Shopping.Merchant.LoyaltyCustomers.V1
Assembly: Google.Shopping.Merchant.LoyaltyCustomers.V1.dll
Syntax
public abstract class LoyaltyCustomerMatchServiceClient
Remarks
Manages customer loyalty program memberships for merchants.
This service allows all merchants, including non-advertisers, to share their first-party customer data of loyalty program members. Google uses this data to personalize organic free listing shopping experiences, in compliance with the Merchant Center Terms of Service.
The service follows a non-standard, imperative pattern,
exposing a single ManageLoyaltyCustomerMatch method rather than
conventional resource identifiers and CRUD operations. This design protects
user privacy by preventing the discovery of a customer's presence or
membership status through standard GET or LIST methods.
Properties
DefaultEndpoint
The default endpoint for the LoyaltyCustomerMatchService 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 LoyaltyCustomerMatchService scopes.
Declaration
public static IReadOnlyList<string> DefaultScopes { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<string> |
Remarks
The default LoyaltyCustomerMatchService scopes are:
- https://www.googleapis.com/auth/content
GrpcClient
The underlying gRPC LoyaltyCustomerMatchService client
Declaration
public virtual LoyaltyCustomerMatchService.LoyaltyCustomerMatchServiceClient GrpcClient { get; }
Property Value
| Type | Description |
|---|---|
| LoyaltyCustomerMatchService.LoyaltyCustomerMatchServiceClient |
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 LoyaltyCustomerMatchServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use LoyaltyCustomerMatchServiceClientBuilder.
Declaration
public static LoyaltyCustomerMatchServiceClient Create()
Returns
| Type | Description |
|---|---|
| LoyaltyCustomerMatchServiceClient | The created LoyaltyCustomerMatchServiceClient. |
CreateAsync(CancellationToken)
Asynchronously creates a LoyaltyCustomerMatchServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use LoyaltyCustomerMatchServiceClientBuilder.
Declaration
public static Task<LoyaltyCustomerMatchServiceClient> CreateAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | The CancellationToken to use while creating the client. |
Returns
| Type | Description |
|---|---|
| Task<LoyaltyCustomerMatchServiceClient> | The task representing the created LoyaltyCustomerMatchServiceClient. |
ManageLoyaltyCustomerMatch(ManageLoyaltyCustomerMatchRequest, CallSettings)
Manages (inserts, updates, or removes) a customer's loyalty tier information.
This method serves as a single interface for all changes to a customer's
loyalty status. The specific action (insert, update, or remove) is
determined by the current state of the merchant-to-customer association and
the loyalty_tier value provided in the request.
Operation Logic:
- Upsert (Insert/Update): Providing any valid tier other than
NON_MEMBERwill associate the customer with that tier. If an association already exists, it will be updated; otherwise, a new one will be created. - Removal: Setting
loyalty_tiertoNON_MEMBERwill remove any existing loyalty association for the customer.
Privacy Note: To protect user privacy, this method consistently returns
a 200 OK status with a default LoyaltyCustomer response if the
customer's identifier cannot be matched to a Google account or if the user
has not opted into loyalty personalization.
Declaration
public virtual ManageLoyaltyCustomerMatchResponse ManageLoyaltyCustomerMatch(ManageLoyaltyCustomerMatchRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ManageLoyaltyCustomerMatchRequest | 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 |
|---|---|
| ManageLoyaltyCustomerMatchResponse | The RPC response. |
Sample code
// Create client
LoyaltyCustomerMatchServiceClient loyaltyCustomerMatchServiceClient = LoyaltyCustomerMatchServiceClient.Create();
// Initialize request argument(s)
ManageLoyaltyCustomerMatchRequest request = new ManageLoyaltyCustomerMatchRequest
{
ParentAsAccountName = AccountName.FromAccount("[ACCOUNT]"),
LoyaltyCustomer = new LoyaltyCustomer(),
};
// Make the request
ManageLoyaltyCustomerMatchResponse response = loyaltyCustomerMatchServiceClient.ManageLoyaltyCustomerMatch(request);
ManageLoyaltyCustomerMatchAsync(ManageLoyaltyCustomerMatchRequest, CallSettings)
Manages (inserts, updates, or removes) a customer's loyalty tier information.
This method serves as a single interface for all changes to a customer's
loyalty status. The specific action (insert, update, or remove) is
determined by the current state of the merchant-to-customer association and
the loyalty_tier value provided in the request.
Operation Logic:
- Upsert (Insert/Update): Providing any valid tier other than
NON_MEMBERwill associate the customer with that tier. If an association already exists, it will be updated; otherwise, a new one will be created. - Removal: Setting
loyalty_tiertoNON_MEMBERwill remove any existing loyalty association for the customer.
Privacy Note: To protect user privacy, this method consistently returns
a 200 OK status with a default LoyaltyCustomer response if the
customer's identifier cannot be matched to a Google account or if the user
has not opted into loyalty personalization.
Declaration
public virtual Task<ManageLoyaltyCustomerMatchResponse> ManageLoyaltyCustomerMatchAsync(ManageLoyaltyCustomerMatchRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ManageLoyaltyCustomerMatchRequest | 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<ManageLoyaltyCustomerMatchResponse> | A Task containing the RPC response. |
Sample code
// Create client
LoyaltyCustomerMatchServiceClient loyaltyCustomerMatchServiceClient = await LoyaltyCustomerMatchServiceClient.CreateAsync();
// Initialize request argument(s)
ManageLoyaltyCustomerMatchRequest request = new ManageLoyaltyCustomerMatchRequest
{
ParentAsAccountName = AccountName.FromAccount("[ACCOUNT]"),
LoyaltyCustomer = new LoyaltyCustomer(),
};
// Make the request
ManageLoyaltyCustomerMatchResponse response = await loyaltyCustomerMatchServiceClient.ManageLoyaltyCustomerMatchAsync(request);
ManageLoyaltyCustomerMatchAsync(ManageLoyaltyCustomerMatchRequest, CancellationToken)
Manages (inserts, updates, or removes) a customer's loyalty tier information.
This method serves as a single interface for all changes to a customer's
loyalty status. The specific action (insert, update, or remove) is
determined by the current state of the merchant-to-customer association and
the loyalty_tier value provided in the request.
Operation Logic:
- Upsert (Insert/Update): Providing any valid tier other than
NON_MEMBERwill associate the customer with that tier. If an association already exists, it will be updated; otherwise, a new one will be created. - Removal: Setting
loyalty_tiertoNON_MEMBERwill remove any existing loyalty association for the customer.
Privacy Note: To protect user privacy, this method consistently returns
a 200 OK status with a default LoyaltyCustomer response if the
customer's identifier cannot be matched to a Google account or if the user
has not opted into loyalty personalization.
Declaration
public virtual Task<ManageLoyaltyCustomerMatchResponse> ManageLoyaltyCustomerMatchAsync(ManageLoyaltyCustomerMatchRequest request, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| ManageLoyaltyCustomerMatchRequest | 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<ManageLoyaltyCustomerMatchResponse> | A Task containing the RPC response. |
Sample code
// Create client
LoyaltyCustomerMatchServiceClient loyaltyCustomerMatchServiceClient = await LoyaltyCustomerMatchServiceClient.CreateAsync();
// Initialize request argument(s)
ManageLoyaltyCustomerMatchRequest request = new ManageLoyaltyCustomerMatchRequest
{
ParentAsAccountName = AccountName.FromAccount("[ACCOUNT]"),
LoyaltyCustomer = new LoyaltyCustomer(),
};
// Make the request
ManageLoyaltyCustomerMatchResponse response = await loyaltyCustomerMatchServiceClient.ManageLoyaltyCustomerMatchAsync(request);
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.