// Copyright 2022 Luca Casonato. All rights reserved. MIT license. /** * Merchant API Client for Deno * ============================ * * Programmatically manage your Merchant Center Accounts. * * Docs: https://developers.devsite.corp.google.com/merchant/api * Source: https://googleapis.deno.dev/v1/merchantapi:reviews_v1beta.ts */ import { auth, CredentialsClient, GoogleAuth, request } from "/_/base@v1/mod.ts"; export { auth, GoogleAuth }; export type { CredentialsClient }; /** * Programmatically manage your Merchant Center Accounts. */ export class MerchantAPI { #client: CredentialsClient | undefined; #baseUrl: string; constructor(client?: CredentialsClient, baseUrl: string = "https://merchantapi.googleapis.com/") { this.#client = client; this.#baseUrl = baseUrl; } /** * Deletes merchant review. * * @param name Required. The ID of the merchant review. Format: accounts/{account}/merchantReviews/{merchantReview} */ async accountsMerchantReviewsDelete(name: string): Promise { const url = new URL(`${this.#baseUrl}reviews/v1beta/${ name }`); const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Empty; } /** * Gets a merchant review. * * @param name Required. The ID of the merchant review. Format: accounts/{account}/merchantReviews/{merchantReview} */ async accountsMerchantReviewsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}reviews/v1beta/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeMerchantReview(data); } /** * Inserts a review for your Merchant Center account. If the review already * exists, then the review is replaced with the new instance. * * @param parent Required. The account where the merchant review will be inserted. Format: accounts/{account} */ async accountsMerchantReviewsInsert(parent: string, req: MerchantReview, opts: AccountsMerchantReviewsInsertOptions = {}): Promise { req = serializeMerchantReview(req); const url = new URL(`${this.#baseUrl}reviews/v1beta/${ parent }/merchantReviews:insert`); if (opts.dataSource !== undefined) { url.searchParams.append("dataSource", String(opts.dataSource)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeMerchantReview(data); } /** * Lists merchant reviews. * * @param parent Required. The account to list merchant reviews for. Format: accounts/{account} */ async accountsMerchantReviewsList(parent: string, opts: AccountsMerchantReviewsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}reviews/v1beta/${ parent }/merchantReviews`); if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeListMerchantReviewsResponse(data); } /** * Deletes a product review. * * @param name Required. The ID of the Product review. Format: accounts/{account}/productReviews/{productReview} */ async accountsProductReviewsDelete(name: string): Promise { const url = new URL(`${this.#baseUrl}reviews/v1beta/${ name }`); const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Empty; } /** * Gets a product review. * * @param name Required. The ID of the merchant review. Format: accounts/{account}/productReviews/{productReview} */ async accountsProductReviewsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}reviews/v1beta/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeProductReview(data); } /** * Inserts a product review. * * @param parent Required. The account where the product review will be inserted. Format: accounts/{account} */ async accountsProductReviewsInsert(parent: string, req: ProductReview, opts: AccountsProductReviewsInsertOptions = {}): Promise { req = serializeProductReview(req); const url = new URL(`${this.#baseUrl}reviews/v1beta/${ parent }/productReviews:insert`); if (opts.dataSource !== undefined) { url.searchParams.append("dataSource", String(opts.dataSource)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeProductReview(data); } /** * Lists product reviews. * * @param parent Required. The account to list product reviews for. Format: accounts/{account} */ async accountsProductReviewsList(parent: string, opts: AccountsProductReviewsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}reviews/v1beta/${ parent }/productReviews`); if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeListProductReviewsResponse(data); } } /** * Additional options for MerchantAPI#accountsMerchantReviewsInsert. */ export interface AccountsMerchantReviewsInsertOptions { /** * Required. The data source of the * [merchantreview](https://support.google.com/merchants/answer/7045996?sjid=5253581244217581976-EU) * Format: `accounts/{account}/dataSources/{datasource}`. */ dataSource?: string; } /** * Additional options for MerchantAPI#accountsMerchantReviewsList. */ export interface AccountsMerchantReviewsListOptions { /** * Optional. The maximum number of merchant reviews to return. The service * can return fewer than this value. The maximum value is 1000; values above * 1000 are coerced to 1000. If unspecified, the maximum number of reviews is * returned. */ pageSize?: number; /** * Optional. A page token, received from a previous `ListMerchantReviews` * call. Provide this to retrieve the subsequent page. When paginating, all * other parameters provided to `ListMerchantReviews` must match the call that * provided the page token. */ pageToken?: string; } /** * Additional options for MerchantAPI#accountsProductReviewsInsert. */ export interface AccountsProductReviewsInsertOptions { /** * Required. Format: `accounts/{account}/dataSources/{datasource}`. */ dataSource?: string; } /** * Additional options for MerchantAPI#accountsProductReviewsList. */ export interface AccountsProductReviewsListOptions { /** * Optional. The maximum number of products to return. The service may return * fewer than this value. */ pageSize?: number; /** * Optional. A page token, received from a previous `ListProductReviews` * call. Provide this to retrieve the subsequent page. When paginating, all * other parameters provided to `ListProductReviews` must match the call that * provided the page token. */ pageToken?: string; } /** * A message that represents custom attributes. Exactly one of `value` or * `group_values` must not be empty. */ export interface CustomAttribute { /** * Subattributes within this attribute group. If `group_values` is not empty, * `value` must be empty. */ groupValues?: CustomAttribute[]; /** * The name of the attribute. */ name?: string; /** * The value of the attribute. If `value` is not empty, `group_values` must * be empty. */ value?: string; } /** * A generic empty message that you can re-use to avoid defining duplicated * empty messages in your APIs. A typical example is to use it as the request or * the response type of an API method. For instance: service Foo { rpc * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } */ export interface Empty { } /** * Response message for the `ListMerchantsReview` method. */ export interface ListMerchantReviewsResponse { /** * The merchant review. */ merchantReviews?: MerchantReview[]; /** * The token to retrieve the next page of results. */ nextPageToken?: string; } function serializeListMerchantReviewsResponse(data: any): ListMerchantReviewsResponse { return { ...data, merchantReviews: data["merchantReviews"] !== undefined ? data["merchantReviews"].map((item: any) => (serializeMerchantReview(item))) : undefined, }; } function deserializeListMerchantReviewsResponse(data: any): ListMerchantReviewsResponse { return { ...data, merchantReviews: data["merchantReviews"] !== undefined ? data["merchantReviews"].map((item: any) => (deserializeMerchantReview(item))) : undefined, }; } /** * response message for the ListProductReviews method. */ export interface ListProductReviewsResponse { /** * A token, which can be sent as `page_token` to retrieve the next page. If * this field is omitted, there are no subsequent pages. */ nextPageToken?: string; /** * The product review. */ productReviews?: ProductReview[]; } function serializeListProductReviewsResponse(data: any): ListProductReviewsResponse { return { ...data, productReviews: data["productReviews"] !== undefined ? data["productReviews"].map((item: any) => (serializeProductReview(item))) : undefined, }; } function deserializeListProductReviewsResponse(data: any): ListProductReviewsResponse { return { ...data, productReviews: data["productReviews"] !== undefined ? data["productReviews"].map((item: any) => (deserializeProductReview(item))) : undefined, }; } /** * A review for a merchant. For more information, see [Introduction to Merchant * Review Feeds](https://developers.google.com/merchant-review-feeds) */ export interface MerchantReview { /** * Optional. A list of merchant review attributes. */ attributes?: MerchantReviewAttributes; /** * Required. A list of custom (merchant-provided) attributes. It can also be * used for submitting any attribute of the data specification in its generic * form (for example, `{ "name": "size type", "value": "regular" }`). This is * useful for submitting attributes not explicitly exposed by the API, such as * experimental attributes. Maximum allowed number of characters for each * custom attribute is 10240 (represents sum of characters for name and * value). Maximum 2500 custom attributes can be set per product, with total * size of 102.4kB. Underscores in custom attribute names are replaced by * spaces upon insertion. */ customAttributes?: CustomAttribute[]; /** * Output only. The primary data source of the merchant review. */ readonly dataSource?: string; /** * Required. The user provided merchant review ID to uniquely identify the * merchant review. */ merchantReviewId?: string; /** * Output only. The status of a merchant review, data validation issues, that * is, information about a merchant review computed asynchronously. */ readonly merchantReviewStatus?: MerchantReviewStatus; /** * Identifier. The name of the merchant review. Format: * `"{merchantreview.name=accounts/{account}/merchantReviews/{merchantReview}}"` */ name?: string; } function serializeMerchantReview(data: any): MerchantReview { return { ...data, attributes: data["attributes"] !== undefined ? serializeMerchantReviewAttributes(data["attributes"]) : undefined, }; } function deserializeMerchantReview(data: any): MerchantReview { return { ...data, attributes: data["attributes"] !== undefined ? deserializeMerchantReviewAttributes(data["attributes"]) : undefined, }; } /** * Attributes. */ export interface MerchantReviewAttributes { /** * Optional. The method used to collect the review. */ collectionMethod?: | "COLLECTION_METHOD_UNSPECIFIED" | "MERCHANT_UNSOLICITED" | "POINT_OF_SALE" | "AFTER_FULFILLMENT"; /** * Required. This should be any freeform text provided by the user and should * not be truncated. If multiple responses to different questions are * provided, all responses should be included, with the minimal context for * the responses to make sense. Context should not be provided if questions * were left unanswered. */ content?: string; /** * Optional. Set to true if the reviewer should remain anonymous. */ isAnonymous?: boolean; /** * Optional. The maximum possible number for the rating. The value of the max * rating must be greater than the value of the min rating. */ maxRating?: bigint; /** * Optional. Human-readable display name for the merchant. */ merchantDisplayName?: string; /** * Required. Must be unique and stable across all requests. In other words, * if a request today and another 90 days ago refer to the same merchant, they * must have the same id. */ merchantId?: string; /** * Optional. URL to the merchant's main website. Do not use a redirect URL * for this value. In other words, the value should point directly to the * merchant's site. */ merchantLink?: string; /** * Optional. URL to the landing page that hosts the reviews for this * merchant. Do not use a redirect URL. */ merchantRatingLink?: string; /** * Optional. The minimum possible number for the rating. This should be the * worst possible rating and should not be a value for no rating. */ minRating?: bigint; /** * Optional. The reviewer's overall rating of the merchant. */ rating?: number; /** * Optional. The country where the reviewer made the order defined by ISO * 3166-1 Alpha-2 Country Code. */ reviewCountry?: string; /** * Optional. A permanent, unique identifier for the author of the review in * the publisher's system. */ reviewerId?: string; /** * Optional. Display name of the review author. */ reviewerUsername?: string; /** * Required. The language of the review defined by BCP-47 language code. */ reviewLanguage?: string; /** * Required. The timestamp indicating when the review was written. */ reviewTime?: Date; /** * Optional. The title of the review. */ title?: string; } function serializeMerchantReviewAttributes(data: any): MerchantReviewAttributes { return { ...data, maxRating: data["maxRating"] !== undefined ? String(data["maxRating"]) : undefined, minRating: data["minRating"] !== undefined ? String(data["minRating"]) : undefined, reviewTime: data["reviewTime"] !== undefined ? data["reviewTime"].toISOString() : undefined, }; } function deserializeMerchantReviewAttributes(data: any): MerchantReviewAttributes { return { ...data, maxRating: data["maxRating"] !== undefined ? BigInt(data["maxRating"]) : undefined, minRating: data["minRating"] !== undefined ? BigInt(data["minRating"]) : undefined, reviewTime: data["reviewTime"] !== undefined ? new Date(data["reviewTime"]) : undefined, }; } /** * The destination status of the merchant review status. */ export interface MerchantReviewDestinationStatus { /** * Output only. The name of the reporting context. */ readonly reportingContext?: | "REPORTING_CONTEXT_ENUM_UNSPECIFIED" | "SHOPPING_ADS" | "DISCOVERY_ADS" | "DEMAND_GEN_ADS" | "DEMAND_GEN_ADS_DISCOVER_SURFACE" | "VIDEO_ADS" | "DISPLAY_ADS" | "LOCAL_INVENTORY_ADS" | "VEHICLE_INVENTORY_ADS" | "FREE_LISTINGS" | "FREE_LOCAL_LISTINGS" | "FREE_LOCAL_VEHICLE_LISTINGS" | "YOUTUBE_SHOPPING" | "CLOUD_RETAIL" | "LOCAL_CLOUD_RETAIL" | "PRODUCT_REVIEWS" | "MERCHANT_REVIEWS" | "YOUTUBE_CHECKOUT"; } /** * The ItemLevelIssue of the merchant review status. */ export interface MerchantReviewItemLevelIssue { /** * Output only. The attribute's name, if the issue is caused by a single * attribute. */ readonly attribute?: string; /** * Output only. The error code of the issue. */ readonly code?: string; /** * Output only. A short issue description in English. */ readonly description?: string; /** * Output only. A detailed issue description in English. */ readonly detail?: string; /** * Output only. The URL of a web page to help with resolving this issue. */ readonly documentation?: string; /** * Output only. The reporting context the issue applies to. */ readonly reportingContext?: | "REPORTING_CONTEXT_ENUM_UNSPECIFIED" | "SHOPPING_ADS" | "DISCOVERY_ADS" | "DEMAND_GEN_ADS" | "DEMAND_GEN_ADS_DISCOVER_SURFACE" | "VIDEO_ADS" | "DISPLAY_ADS" | "LOCAL_INVENTORY_ADS" | "VEHICLE_INVENTORY_ADS" | "FREE_LISTINGS" | "FREE_LOCAL_LISTINGS" | "FREE_LOCAL_VEHICLE_LISTINGS" | "YOUTUBE_SHOPPING" | "CLOUD_RETAIL" | "LOCAL_CLOUD_RETAIL" | "PRODUCT_REVIEWS" | "MERCHANT_REVIEWS" | "YOUTUBE_CHECKOUT"; /** * Output only. Whether the issue can be resolved by the merchant. */ readonly resolution?: string; /** * Output only. How this issue affects serving of the merchant review. */ readonly severity?: | "SEVERITY_UNSPECIFIED" | "NOT_IMPACTED" | "DISAPPROVED"; } /** * The status of a merchant review, data validation issues, that is, * information about a merchant review computed asynchronously. */ export interface MerchantReviewStatus { /** * Output only. Date on which the item has been created, in [ISO * 8601](http://en.wikipedia.org/wiki/ISO_8601) format. */ readonly createTime?: Date; /** * Output only. The intended destinations for the merchant review. */ readonly destinationStatuses?: MerchantReviewDestinationStatus[]; /** * Output only. A list of all issues associated with the merchant review. */ readonly itemLevelIssues?: MerchantReviewItemLevelIssue[]; /** * Output only. Date on which the item has been last updated, in [ISO * 8601](http://en.wikipedia.org/wiki/ISO_8601) format. */ readonly lastUpdateTime?: Date; } /** * The change that happened to the product including old value, new value, * country code as the region code and reporting context. */ export interface ProductChange { /** * The new value of the changed resource or attribute. */ newValue?: string; /** * The old value of the changed resource or attribute. */ oldValue?: string; /** * Countries that have the change (if applicable) */ regionCode?: string; /** * Reporting contexts that have the change (if applicable) */ reportingContext?: | "REPORTING_CONTEXT_ENUM_UNSPECIFIED" | "SHOPPING_ADS" | "DISCOVERY_ADS" | "DEMAND_GEN_ADS" | "DEMAND_GEN_ADS_DISCOVER_SURFACE" | "VIDEO_ADS" | "DISPLAY_ADS" | "LOCAL_INVENTORY_ADS" | "VEHICLE_INVENTORY_ADS" | "FREE_LISTINGS" | "FREE_LOCAL_LISTINGS" | "FREE_LOCAL_VEHICLE_LISTINGS" | "YOUTUBE_SHOPPING" | "CLOUD_RETAIL" | "LOCAL_CLOUD_RETAIL" | "PRODUCT_REVIEWS" | "MERCHANT_REVIEWS" | "YOUTUBE_CHECKOUT"; } /** * A review for a product. For more information, see [Introduction to Product * Review Feeds](https://developers.google.com/product-review-feeds) */ export interface ProductReview { /** * Optional. A list of product review attributes. */ attributes?: ProductReviewAttributes; /** * Optional. A list of custom (merchant-provided) attributes. */ customAttributes?: CustomAttribute[]; /** * Output only. The primary data source of the product review. */ readonly dataSource?: string; /** * Identifier. The name of the product review. Format: * `"{productreview.name=accounts/{account}/productReviews/{productReview}}"` */ name?: string; /** * Required. The permanent, unique identifier for the product review in the * publisher’s system. */ productReviewId?: string; /** * Output only. The status of a product review, data validation issues, that * is, information about a product review computed asynchronously. */ readonly productReviewStatus?: ProductReviewStatus; } function serializeProductReview(data: any): ProductReview { return { ...data, attributes: data["attributes"] !== undefined ? serializeProductReviewAttributes(data["attributes"]) : undefined, }; } function deserializeProductReview(data: any): ProductReview { return { ...data, attributes: data["attributes"] !== undefined ? deserializeProductReviewAttributes(data["attributes"]) : undefined, }; } /** * Attributes. */ export interface ProductReviewAttributes { /** * Optional. The name of the aggregator of the product reviews. A publisher * may use a reviews aggregator to manage reviews and provide the feeds. This * element indicates the use of an aggregator and contains information about * the aggregator. */ aggregatorName?: string; /** * Optional. Contains ASINs (Amazon Standard Identification Numbers) * associated with a product. */ asins?: string[]; /** * Optional. Contains brand names associated with a product. */ brands?: string[]; /** * Optional. The method used to collect the review. */ collectionMethod?: | "COLLECTION_METHOD_UNSPECIFIED" | "UNSOLICITED" | "POST_FULFILLMENT"; /** * Optional. Contains the disadvantages based on the opinion of the reviewer. * Omit boilerplate text like "con:" unless it was written by the reviewer. */ cons?: string[]; /** * Required. The content of the review. */ content?: string; /** * Optional. Contains GTINs (global trade item numbers) associated with a * product. Sub-types of GTINs (e.g. UPC, EAN, ISBN, JAN) are supported. */ gtins?: string[]; /** * Optional. Indicates whether the review is marked as spam in the * publisher's system. */ isSpam?: boolean; /** * Optional. The maximum possible number for the rating. The value of the max * rating must be greater than the value of the min attribute. */ maxRating?: bigint; /** * Optional. Contains the ratings associated with the review. The minimum * possible number for the rating. This should be the worst possible rating * and should not be a value for no rating. */ minRating?: bigint; /** * Optional. Contains MPNs (manufacturer part numbers) associated with a * product. */ mpns?: string[]; /** * Optional. The URI of the product. This URI can have the same value as the * `review_link` element, if the review URI and the product URI are the same. */ productLinks?: string[]; /** * Optional. Descriptive name of a product. */ productNames?: string[]; /** * Optional. Contains the advantages based on the opinion of the reviewer. * Omit boilerplate text like "pro:" unless it was written by the reviewer. */ pros?: string[]; /** * Optional. A link to the company favicon of the publisher. The image * dimensions should be favicon size: 16x16 pixels. The image format should be * GIF, JPG or PNG. */ publisherFavicon?: string; /** * Optional. The name of the publisher of the product reviews. The * information about the publisher, which may be a retailer, manufacturer, * reviews service company, or any entity that publishes product reviews. */ publisherName?: string; /** * Optional. The reviewer's overall rating of the product. */ rating?: number; /** * Optional. The country of the review defined by ISO 3166-1 Alpha-2 Country * Code. */ reviewCountry?: string; /** * Optional. The author of the product review. A permanent, unique identifier * for the author of the review in the publisher's system. */ reviewerId?: string; /** * Optional. A URI to an image of the reviewed product created by the review * author. The URI does not have to end with an image file extension. */ reviewerImageLinks?: string[]; /** * Optional. Set to true if the reviewer should remain anonymous. */ reviewerIsAnonymous?: boolean; /** * Optional. The name of the reviewer of the product review. */ reviewerUsername?: string; /** * Optional. The language of the review defined by BCP-47 language code. */ reviewLanguage?: string; /** * Optional. The URI of the review landing page. */ reviewLink?: ReviewLink; /** * Required. The timestamp indicating when the review was written. */ reviewTime?: Date; /** * Optional. Contains SKUs (stock keeping units) associated with a product. * Often this matches the product Offer Id in the product feed. */ skus?: string[]; /** * Optional. The name of the subclient of the product reviews. The subclient * is an identifier of the product review source. It should be equivalent to * the directory provided in the file data source path. */ subclientName?: string; /** * Optional. The title of the review. */ title?: string; /** * Optional. A permanent, unique identifier for the transaction associated * with the review in the publisher's system. This ID can be used to indicate * that multiple reviews are associated with the same transaction. */ transactionId?: string; } function serializeProductReviewAttributes(data: any): ProductReviewAttributes { return { ...data, maxRating: data["maxRating"] !== undefined ? String(data["maxRating"]) : undefined, minRating: data["minRating"] !== undefined ? String(data["minRating"]) : undefined, reviewTime: data["reviewTime"] !== undefined ? data["reviewTime"].toISOString() : undefined, }; } function deserializeProductReviewAttributes(data: any): ProductReviewAttributes { return { ...data, maxRating: data["maxRating"] !== undefined ? BigInt(data["maxRating"]) : undefined, minRating: data["minRating"] !== undefined ? BigInt(data["minRating"]) : undefined, reviewTime: data["reviewTime"] !== undefined ? new Date(data["reviewTime"]) : undefined, }; } /** * The destination status of the product review status. */ export interface ProductReviewDestinationStatus { /** * Output only. The name of the reporting context. */ readonly reportingContext?: | "REPORTING_CONTEXT_ENUM_UNSPECIFIED" | "SHOPPING_ADS" | "DISCOVERY_ADS" | "DEMAND_GEN_ADS" | "DEMAND_GEN_ADS_DISCOVER_SURFACE" | "VIDEO_ADS" | "DISPLAY_ADS" | "LOCAL_INVENTORY_ADS" | "VEHICLE_INVENTORY_ADS" | "FREE_LISTINGS" | "FREE_LOCAL_LISTINGS" | "FREE_LOCAL_VEHICLE_LISTINGS" | "YOUTUBE_SHOPPING" | "CLOUD_RETAIL" | "LOCAL_CLOUD_RETAIL" | "PRODUCT_REVIEWS" | "MERCHANT_REVIEWS" | "YOUTUBE_CHECKOUT"; } /** * The ItemLevelIssue of the product review status. */ export interface ProductReviewItemLevelIssue { /** * Output only. The attribute's name, if the issue is caused by a single * attribute. */ readonly attribute?: string; /** * Output only. The error code of the issue. */ readonly code?: string; /** * Output only. A short issue description in English. */ readonly description?: string; /** * Output only. A detailed issue description in English. */ readonly detail?: string; /** * Output only. The URL of a web page to help with resolving this issue. */ readonly documentation?: string; /** * Output only. The reporting context the issue applies to. */ readonly reportingContext?: | "REPORTING_CONTEXT_ENUM_UNSPECIFIED" | "SHOPPING_ADS" | "DISCOVERY_ADS" | "DEMAND_GEN_ADS" | "DEMAND_GEN_ADS_DISCOVER_SURFACE" | "VIDEO_ADS" | "DISPLAY_ADS" | "LOCAL_INVENTORY_ADS" | "VEHICLE_INVENTORY_ADS" | "FREE_LISTINGS" | "FREE_LOCAL_LISTINGS" | "FREE_LOCAL_VEHICLE_LISTINGS" | "YOUTUBE_SHOPPING" | "CLOUD_RETAIL" | "LOCAL_CLOUD_RETAIL" | "PRODUCT_REVIEWS" | "MERCHANT_REVIEWS" | "YOUTUBE_CHECKOUT"; /** * Output only. Whether the issue can be resolved by the merchant. */ readonly resolution?: string; /** * Output only. How this issue affects serving of the product review. */ readonly severity?: | "SEVERITY_UNSPECIFIED" | "NOT_IMPACTED" | "DISAPPROVED"; } /** * Product review status. */ export interface ProductReviewStatus { /** * Output only. Date on which the item has been created, in [ISO * 8601](http://en.wikipedia.org/wiki/ISO_8601) format. */ readonly createTime?: Date; /** * Output only. The intended destinations for the product review. */ readonly destinationStatuses?: ProductReviewDestinationStatus[]; /** * Output only. A list of all issues associated with the product review. */ readonly itemLevelIssues?: ProductReviewItemLevelIssue[]; /** * Output only. Date on which the item has been last updated, in [ISO * 8601](http://en.wikipedia.org/wiki/ISO_8601) format. */ readonly lastUpdateTime?: Date; } /** * The message that the merchant will receive to notify about product status * change event */ export interface ProductStatusChangeMessage { /** * The target account that owns the entity that changed. Format : * `accounts/{merchant_id}` */ account?: string; /** * The attribute in the resource that changed, in this case it will be always * `Status`. */ attribute?: | "ATTRIBUTE_UNSPECIFIED" | "STATUS"; /** * A message to describe the change that happened to the product */ changes?: ProductChange[]; /** * The product expiration time. This field will not bet set if the * notification is sent for a product deletion event. */ expirationTime?: Date; /** * The account that manages the merchant's account. can be the same as * merchant id if it is standalone account. Format : * `accounts/{service_provider_id}` */ managingAccount?: string; /** * The product name. Format: * `{product.name=accounts/{account}/products/{product}}` */ resource?: string; /** * The product id. */ resourceId?: string; /** * The resource that changed, in this case it will always be `Product`. */ resourceType?: | "RESOURCE_UNSPECIFIED" | "PRODUCT"; } function serializeProductStatusChangeMessage(data: any): ProductStatusChangeMessage { return { ...data, expirationTime: data["expirationTime"] !== undefined ? data["expirationTime"].toISOString() : undefined, }; } function deserializeProductStatusChangeMessage(data: any): ProductStatusChangeMessage { return { ...data, expirationTime: data["expirationTime"] !== undefined ? new Date(data["expirationTime"]) : undefined, }; } /** * The URI of the review landing page. */ export interface ReviewLink { /** * Optional. The URI of the review landing page. For example: * `http://www.example.com/review_5.html`. */ link?: string; /** * Optional. Type of the review URI. */ type?: | "TYPE_UNSPECIFIED" | "SINGLETON" | "GROUP"; }