diff --git a/packages/google-shopping-merchant-products/protos/google/shopping/merchant/products/v1/productinputs.proto b/packages/google-shopping-merchant-products/protos/google/shopping/merchant/products/v1/productinputs.proto index 666ccb4362e..d235624e8cd 100644 --- a/packages/google-shopping-merchant-products/protos/google/shopping/merchant/products/v1/productinputs.proto +++ b/packages/google-shopping-merchant-products/protos/google/shopping/merchant/products/v1/productinputs.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -39,11 +39,11 @@ service ProductInputsService { option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content"; // [Uploads a product input to your Merchant Center - // account](/merchant/api/guides/products/overview#upload-product-input). You + // account](/merchant/api/guides/products/add-manage#add_a_product). You // must have a products [data - // source](/merchant/api/guides/data-sources/overview) to be able to insert a - // product. The unique identifier of the data source is passed as a query - // parameter in the request URL. + // source](/merchant/api/guides/data-sources/api-sources#create-primary-data-source) + // to be able to insert a product. The unique identifier of the data source is + // passed as a query parameter in the request URL. // // If a product input with the same contentLanguage, offerId, and dataSource // already exists, then the product input inserted by this method replaces @@ -59,6 +59,8 @@ service ProductInputsService { } // Updates the existing product input in your Merchant Center account. + // The name of the product input to update is taken from the `name` field + // within the `ProductInput` resource. // // After inserting, updating, or deleting a product input, it may take several // minutes before the processed product can be retrieved. @@ -117,16 +119,44 @@ message ProductInput { singular: "productInput" }; - // Identifier. The name of the product input. + // Identifier. The name of the product. // Format: `accounts/{account}/productInputs/{productinput}` - // where the last section `productinput` consists of: - // `content_language~feed_label~offer_id` - // example for product input name is - // `accounts/123/productInputs/en~US~sku123`. A legacy local product input - // name would be `accounts/123/productInputs/local~en~US~sku123`. - // Note: For calls to the v1beta version, the `productInput` section consists - // of: `channel~content_language~feed_label~offer_id`, for example: - // `accounts/123/productInputs/online~en~US~sku123`. + // + // The {productinput} segment is a unique identifier for the product. + // This identifier must be unique within a merchant account and generally + // follows the structure: `content_language~feed_label~offer_id`. Example: + // `en~US~sku123` For legacy local products, the structure is: + // `local~content_language~feed_label~offer_id`. Example: `local~en~US~sku123` + // + // The format of the {productinput} segment in the URL is automatically + // detected by the server, supporting two options: + // + // 1. **Encoded Format**: The `{productinput}` segment is an unpadded + // base64url + // encoded string (RFC 4648 Section 5). The decoded string must result + // in the `content_language~feed_label~offer_id` structure. This encoding + // MUST be used if any part of the product identifier (like `offer_id`) + // contains characters such as `/`, `%`, or `~`. + // * Example: To represent the product ID `en~US~sku/123`, the + // `{productinput}` segment must be the base64url encoding of this + // string, which is `ZW5-VVMtc2t1LzEyMw`. The full resource name + // for the product would be + // `accounts/123/productinputs/ZW5-VVMtc2t1LzEyMw`. + // + // 2. **Plain Format**: The `{productinput}` segment is the tilde-separated + // string + // `content_language~feed_label~offer_id`. This format is suitable only + // when `content_language`, `feed_label`, and `offer_id` do not contain + // URL-problematic characters like `/`, `%`, or `~`. + // + // We recommend using the **Encoded Format** for all product IDs to ensure + // correct parsing, especially those containing special characters. The + // presence of tilde (`~`) characters in the `{productinput}` segment is used + // to differentiate between the two formats. + // + // Note: For calls to the v1beta version, the plain format is + // `channel~content_language~feed_label~offer_id`, for example: + // `accounts/123/productinputs/online~en~US~sku123`. string name = 1 [(google.api.field_behavior) = IDENTIFIER]; // Output only. The name of the processed product. @@ -227,8 +257,8 @@ message InsertProductInputRequest { // Required. The primary or supplemental product data source name. If the // product already exists and data source provided is different, then the // product will be moved to a new data source. For more information, see - // [Overview of Data sources - // sub-API](/merchant/api/guides/data-sources/overview). + // [Create a primary data + // source](/merchant/api/guides/data-sources/api-sources#create-primary-data-source). // // Only API data sources are supported. // @@ -243,7 +273,8 @@ message InsertProductInputRequest { // input must be from the same data source. message UpdateProductInputRequest { // Required. The product input resource to update. Information you submit will - // be applied to the processed product as well. + // be applied to the processed product as well. The `name` field within this + // resource identifies the product input to be updated. ProductInput product_input = 1 [(google.api.field_behavior) = REQUIRED]; // Optional. The list of product attributes to be updated. @@ -276,12 +307,44 @@ message UpdateProductInputRequest { // Request message for the DeleteProductInput method. message DeleteProductInputRequest { - // Required. The name of the product input resource to delete. - // Format: `accounts/{account}/productInputs/{product}` - // where the last section `product` consists of: - // `content_language~feed_label~offer_id` - // example for product name is - // `accounts/123/productInputs/en~US~sku123`. + // Required. The name of the product input to delete. + // Format: `accounts/{account}/productInputs/{productInput}` + // + // The {productInput} segment is a unique identifier for the product. + // This identifier must be unique within a merchant account and generally + // follows the structure: `content_language~feed_label~offer_id`. Example: + // `en~US~sku123` For legacy local products, the structure is: + // `local~content_language~feed_label~offer_id`. Example: `local~en~US~sku123` + // + // The format of the {productInput} segment in the URL is automatically + // detected by the server, supporting two options: + // + // 1. **Encoded Format**: The `{productInput}` segment is an unpadded + // base64url + // encoded string (RFC 4648 Section 5). The decoded string must result + // in the `content_language~feed_label~offer_id` structure. This encoding + // MUST be used if any part of the product identifier (like `offer_id`) + // contains characters such as `/`, `%`, or `~`. + // * Example: To represent the product ID `en~US~sku/123`, the + // `{productInput}` segment must be the base64url encoding of this + // string, which is `ZW5-VVMtc2t1LzEyMw`. The full resource name + // for the product would be + // `accounts/123/productInputs/ZW5-VVMtc2t1LzEyMw`. + // + // 2. **Plain Format**: The `{productInput}` segment is the tilde-separated + // string + // `content_language~feed_label~offer_id`. This format is suitable only + // when `content_language`, `feed_label`, and `offer_id` do not contain + // URL-problematic characters like `/`, `%`, or `~`. + // + // We recommend using the **Encoded Format** for all product IDs to ensure + // correct parsing, especially those containing special characters. The + // presence of tilde (`~`) characters in the `{productInput}` segment is used + // to differentiate between the two formats. + // + // Note: For calls to the v1beta version, the plain format is + // `channel~content_language~feed_label~offer_id`, for example: + // `accounts/123/productinputs/online~en~US~sku123`. string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { diff --git a/packages/google-shopping-merchant-products/protos/google/shopping/merchant/products/v1/products.proto b/packages/google-shopping-merchant-products/protos/google/shopping/merchant/products/v1/products.proto index e6b585f71e7..a9090771441 100644 --- a/packages/google-shopping-merchant-products/protos/google/shopping/merchant/products/v1/products.proto +++ b/packages/google-shopping-merchant-products/protos/google/shopping/merchant/products/v1/products.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -164,16 +164,42 @@ message Product { // Request message for the GetProduct method. message GetProductRequest { - // Required. The name of the product to retrieve. - // Format: - // `accounts/{account}/products/{product}` where the last - // section `product` consists of: - // `content_language~feed_label~offer_id` - // example for product name is `accounts/123/products/en~US~sku123`. A legacy - // local product name would be `accounts/123/products/local~en~US~sku123`. - // Note: For calls to the v1beta version, the `product` section consists - // of: `channel~content_language~feed_label~offer_id`, for example: - // `accounts/123/products/online~en~US~sku123`. + // Required. The name of the product. + // Format: `accounts/{account}/products/{product}` + // + // The `{product}` segment is a unique identifier for the product. + // This identifier must be unique within a merchant account and generally + // follows the structure: `content_language~feed_label~offer_id`. Example: + // `en~US~sku123` For legacy local products, the structure is: + // `local~content_language~feed_label~offer_id`. Example: `local~en~US~sku123` + // + // The format of the `{product}` segment in the URL is automatically detected + // by the server, supporting two options: + // + // 1. **Encoded Format**: The `{product}` segment is an unpadded base64url + // encoded string (RFC 4648 Section 5). The decoded string must result + // in the `content_language~feed_label~offer_id` structure. This encoding + // MUST be used if any part of the product identifier (like `offer_id`) + // contains characters such as `/`, `%`, or `~`. + // * Example: To represent the product ID `en~US~sku/123`, the + // `{product}` segment must be the base64url encoding of this + // string, which is `ZW5-VVMtc2t1LzEyMw`. The full resource name + // for the product would be + // `accounts/123/products/ZW5-VVMtc2t1LzEyMw`. + // + // 2. **Plain Format**: The `{product}` segment is the tilde-separated string + // `content_language~feed_label~offer_id`. This format is suitable only + // when `content_language`, `feed_label`, and `offer_id` do not contain + // URL-problematic characters like `/`, `%`, or `~`. + // + // We recommend using the **Encoded Format** for all product IDs to ensure + // correct parsing, especially those containing special characters. The + // presence of tilde (`~`) characters in the `{product}` segment is used to + // differentiate between the two formats. + // + // Note: For calls to the v1beta version, the plain format is + // `channel~content_language~feed_label~offer_id`, for example: + // `accounts/123/products/online~en~US~sku123`. string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { diff --git a/packages/google-shopping-merchant-products/protos/google/shopping/merchant/products/v1/products_common.proto b/packages/google-shopping-merchant-products/protos/google/shopping/merchant/products/v1/products_common.proto index 914cd7f2ec3..65f5d5690db 100644 --- a/packages/google-shopping-merchant-products/protos/google/shopping/merchant/products/v1/products_common.proto +++ b/packages/google-shopping-merchant-products/protos/google/shopping/merchant/products/v1/products_common.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -39,6 +39,9 @@ enum SubscriptionPeriod { // Indicates that the subscription period is year. YEAR = 2; + + // Indicates that the subscription period is week. + WEEK = 3; } // Target [age group](https://support.google.com/merchants/answer/6324463) of @@ -493,6 +496,23 @@ enum CarrierTransitTimeOption { // Product attributes. message ProductAttributes { + // The business days during which orders are on their path to fulfillment. + // If not provided, Monday to Friday business days will be assumed. + message ShippingBusinessDaysConfig { + // The [CLDR territory + // code](http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml) + // of the country to which an item will ship. + optional string country = 1; + + // Effective days of the week considered for the delivery time calculation. + // May not be empty. The more business days included the faster the + // delivery. Can be set through individual days (e.g. `MTWRF`), or day + // ranges (e.g. `Mon-Fri`). For more information about accepted formats, + // see [Shipping handling business + // days](https://support.google.com/merchants/answer/16072859). + optional string business_days = 2; + } + // Carrier-based shipping configuration. Allows for setting shipping speed or // shipping cost based on a carrier's provided info. message CarrierShipping { @@ -912,7 +932,7 @@ message ProductAttributes { // Number and amount of installments to pay for an item. ProductInstallment installment = 32; - // Number of periods (months or years) and amount of payment per period + // Number of periods (weeks, months or years) and amount of payment per period // for an item with an associated subscription contract. SubscriptionCost subscription_cost = 33; @@ -983,6 +1003,17 @@ message ProductAttributes { // Minimal product handling time (in business days). optional int64 min_handling_time = 45; + // The business days during which orders can be handled. If not provided, + // Monday to Friday business days will be assumed. + repeated ShippingBusinessDaysConfig shipping_handling_business_days = 143; + + // The business days during which orders are in transit. + // If not provided, Monday to Friday business days will be assumed. + repeated ShippingBusinessDaysConfig shipping_transit_business_days = 144; + + // The handling cutoff times for shipping. + repeated HandlingCutoffTime handling_cutoff_times = 141; + // The shipping label of the product, used to group product in account-level // shipping rules. optional string shipping_label = 46; @@ -1238,6 +1269,7 @@ message SubscriptionCost { // Supported values are: // * "`month`" // * "`year`" + // * "`week`" SubscriptionPeriod period = 1; // The number of subscription periods the buyer has to pay. @@ -1391,6 +1423,20 @@ message Shipping { // [maxTransitTime][google.shopping.merchant.products.v1.Shipping.max_transit_time] // is present. optional int64 max_transit_time = 11; + + // The handling cutoff time until which an order has to be placed to be + // processed in the same day. This is a string in format of HHMM (e.g. + // `1530`) for 3:30 PM. If not configured, the cutoff time will be defaulted + // to 8AM PST and `handling_cutoff_timezone` will be ignored. + optional string handling_cutoff_time = 12; + + // [Timezone + // identifier](https://developers.google.com/adwords/api/docs/appendix/codes-formats#timezone-ids) + // For example `Europe/Zurich`. This field only applies if + // `handling_cutoff_time` is set. If `handling_cutoff_time` is set but this + // field is not set, the shipping destination timezone will be used. If both + // fields are not set, the handling cutoff time will default to 8AM PST. + optional string handling_cutoff_timezone = 13; } // Conditions to be met for a product to have free shipping. @@ -1491,6 +1537,10 @@ message ProductWeight { // a product computed asynchronously. message ProductStatus { // The destination status of the product status. + // + // Equivalent to + // [`StatusPerReportingContext`][google.shopping.merchant.reports.v1.ProductView.StatusPerReportingContext] + // in Reports API. message DestinationStatus { // The name of the reporting context. google.shopping.type.ReportingContext.ReportingContextEnum @@ -1668,3 +1718,29 @@ message AutomatedDiscounts { // the product is not available. google.shopping.type.Price gad_price = 3; } + +// Configuration for offer or offer-country level shipping handling cutoff time. +message HandlingCutoffTime { + // The [CLDR territory + // code](http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml) + // of the country to which the handling cutoff time applies. + optional string country = 1; + + // The handling cutoff time until which an order has to be placed to be + // processed in the same day. This is a string in format of HHMM (e.g. `1530`) + // for 3:30 PM. + // If not configured, the cutoff time will be defaulted to 8AM PST. + optional string cutoff_time = 2; + + // [Timezone + // identifier](https://developers.google.com/adwords/api/docs/appendix/codes-formats#timezone-ids) + // For example 'Europe/Zurich'. If not set, the shipping destination + // timezone will be used. + optional string cutoff_timezone = 3; + + // This field only applies to same-day delivery. If true, prevents next-day + // delivery from being shown for this offer after the cutoff time. This field + // only applies to same-day delivery offers, for merchants who want to + // explicitly disable it. + optional bool disable_delivery_after_cutoff = 4; +} diff --git a/packages/google-shopping-merchant-products/protos/google/shopping/type/types.proto b/packages/google-shopping-merchant-products/protos/google/shopping/type/types.proto index 641bcf066cb..962e3345c67 100644 --- a/packages/google-shopping-merchant-products/protos/google/shopping/type/types.proto +++ b/packages/google-shopping-merchant-products/protos/google/shopping/type/types.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -79,7 +79,6 @@ message CustomAttribute { // // Destinations are used in Merchant Center to allow you to control where the // products from your data feed should be displayed. -// message Destination { // Destination values. enum DestinationEnum { @@ -105,6 +104,25 @@ message Destination { // [YouTube Shopping](https://support.google.com/merchants/answer/12362804). YOUTUBE_SHOPPING = 6; + + // Youtube shopping checkout. + YOUTUBE_SHOPPING_CHECKOUT = 7; + + // [Youtube Affiliate](https://support.google.com/youtube/answer/13376398). + YOUTUBE_AFFILIATE = 8; + + // [Free vehicle + // listings](https://support.google.com/merchants/answer/11189169). + FREE_VEHICLE_LISTINGS = 9; + + // [Vehicle ads](https://support.google.com/merchants/answer/11189169). + VEHICLE_ADS = 10; + + // [Cloud retail](https://cloud.google.com/solutions/retail). + CLOUD_RETAIL = 11; + + // [Local cloud retail](https://cloud.google.com/solutions/retail). + LOCAL_CLOUD_RETAIL = 12; } } @@ -115,7 +133,6 @@ message Destination { // ads](https://support.google.com/merchants/answer/6149970)) or a subset of // formats within a destination (for example, [Demand Gen // ads](https://support.google.com/merchants/answer/13389785)). -// message ReportingContext { // Reporting context values. enum ReportingContextEnum { @@ -155,6 +172,10 @@ message ReportingContext { // listings](https://support.google.com/merchants/answer/9199328). FREE_LISTINGS = 7; + // [Free product listings on UCP + // checkout](https://developers.google.com/merchant/ucp). + FREE_LISTINGS_UCP_CHECKOUT = 19; + // [Free local product // listings](https://support.google.com/merchants/answer/9825611). FREE_LOCAL_LISTINGS = 8; @@ -163,6 +184,9 @@ message ReportingContext { // listings](https://support.google.com/merchants/answer/11544533). FREE_LOCAL_VEHICLE_LISTINGS = 9; + // [Youtube Affiliate](https://support.google.com/youtube/answer/13376398). + YOUTUBE_AFFILIATE = 18; + // [YouTube // Shopping](https://support.google.com/merchants/answer/13478370). YOUTUBE_SHOPPING = 10; @@ -172,6 +196,18 @@ message ReportingContext { // [Local cloud retail](https://cloud.google.com/solutions/retail). LOCAL_CLOUD_RETAIL = 12; + + // [Product + // Reviews](https://support.google.com/merchants/answer/14620732). + PRODUCT_REVIEWS = 15; + + // [Merchant + // Reviews](https://developers.google.com/merchant-review-feeds). + MERCHANT_REVIEWS = 16; + + // YouTube Checkout + // . + YOUTUBE_CHECKOUT = 17; } } diff --git a/packages/google-shopping-merchant-products/protos/protos.d.ts b/packages/google-shopping-merchant-products/protos/protos.d.ts index 2f65263347c..b48a9e74d1b 100644 --- a/packages/google-shopping-merchant-products/protos/protos.d.ts +++ b/packages/google-shopping-merchant-products/protos/protos.d.ts @@ -586,7 +586,8 @@ export namespace google { enum SubscriptionPeriod { SUBSCRIPTION_PERIOD_UNSPECIFIED = 0, MONTH = 1, - YEAR = 2 + YEAR = 2, + WEEK = 3 } /** AgeGroup enum. */ @@ -921,6 +922,15 @@ export namespace google { /** ProductAttributes minHandlingTime */ minHandlingTime?: (number|Long|string|null); + /** ProductAttributes shippingHandlingBusinessDays */ + shippingHandlingBusinessDays?: (google.shopping.merchant.products.v1.ProductAttributes.IShippingBusinessDaysConfig[]|null); + + /** ProductAttributes shippingTransitBusinessDays */ + shippingTransitBusinessDays?: (google.shopping.merchant.products.v1.ProductAttributes.IShippingBusinessDaysConfig[]|null); + + /** ProductAttributes handlingCutoffTimes */ + handlingCutoffTimes?: (google.shopping.merchant.products.v1.IHandlingCutoffTime[]|null); + /** ProductAttributes shippingLabel */ shippingLabel?: (string|null); @@ -1210,6 +1220,15 @@ export namespace google { /** ProductAttributes minHandlingTime. */ public minHandlingTime?: (number|Long|string|null); + /** ProductAttributes shippingHandlingBusinessDays. */ + public shippingHandlingBusinessDays: google.shopping.merchant.products.v1.ProductAttributes.IShippingBusinessDaysConfig[]; + + /** ProductAttributes shippingTransitBusinessDays. */ + public shippingTransitBusinessDays: google.shopping.merchant.products.v1.ProductAttributes.IShippingBusinessDaysConfig[]; + + /** ProductAttributes handlingCutoffTimes. */ + public handlingCutoffTimes: google.shopping.merchant.products.v1.IHandlingCutoffTime[]; + /** ProductAttributes shippingLabel. */ public shippingLabel?: (string|null); @@ -1425,6 +1444,109 @@ export namespace google { namespace ProductAttributes { + /** Properties of a ShippingBusinessDaysConfig. */ + interface IShippingBusinessDaysConfig { + + /** ShippingBusinessDaysConfig country */ + country?: (string|null); + + /** ShippingBusinessDaysConfig businessDays */ + businessDays?: (string|null); + } + + /** Represents a ShippingBusinessDaysConfig. */ + class ShippingBusinessDaysConfig implements IShippingBusinessDaysConfig { + + /** + * Constructs a new ShippingBusinessDaysConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.products.v1.ProductAttributes.IShippingBusinessDaysConfig); + + /** ShippingBusinessDaysConfig country. */ + public country?: (string|null); + + /** ShippingBusinessDaysConfig businessDays. */ + public businessDays?: (string|null); + + /** + * Creates a new ShippingBusinessDaysConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ShippingBusinessDaysConfig instance + */ + public static create(properties?: google.shopping.merchant.products.v1.ProductAttributes.IShippingBusinessDaysConfig): google.shopping.merchant.products.v1.ProductAttributes.ShippingBusinessDaysConfig; + + /** + * Encodes the specified ShippingBusinessDaysConfig message. Does not implicitly {@link google.shopping.merchant.products.v1.ProductAttributes.ShippingBusinessDaysConfig.verify|verify} messages. + * @param message ShippingBusinessDaysConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.products.v1.ProductAttributes.IShippingBusinessDaysConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ShippingBusinessDaysConfig message, length delimited. Does not implicitly {@link google.shopping.merchant.products.v1.ProductAttributes.ShippingBusinessDaysConfig.verify|verify} messages. + * @param message ShippingBusinessDaysConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.products.v1.ProductAttributes.IShippingBusinessDaysConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShippingBusinessDaysConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ShippingBusinessDaysConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.shopping.merchant.products.v1.ProductAttributes.ShippingBusinessDaysConfig; + + /** + * Decodes a ShippingBusinessDaysConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ShippingBusinessDaysConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.shopping.merchant.products.v1.ProductAttributes.ShippingBusinessDaysConfig; + + /** + * Verifies a ShippingBusinessDaysConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ShippingBusinessDaysConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ShippingBusinessDaysConfig + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.products.v1.ProductAttributes.ShippingBusinessDaysConfig; + + /** + * Creates a plain object from a ShippingBusinessDaysConfig message. Also converts values to other types if specified. + * @param message ShippingBusinessDaysConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.products.v1.ProductAttributes.ShippingBusinessDaysConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ShippingBusinessDaysConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ShippingBusinessDaysConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a CarrierShipping. */ interface ICarrierShipping { @@ -2574,6 +2696,12 @@ export namespace google { /** Shipping maxTransitTime */ maxTransitTime?: (number|Long|string|null); + + /** Shipping handlingCutoffTime */ + handlingCutoffTime?: (string|null); + + /** Shipping handlingCutoffTimezone */ + handlingCutoffTimezone?: (string|null); } /** Represents a Shipping. */ @@ -2618,6 +2746,12 @@ export namespace google { /** Shipping maxTransitTime. */ public maxTransitTime?: (number|Long|string|null); + /** Shipping handlingCutoffTime. */ + public handlingCutoffTime?: (string|null); + + /** Shipping handlingCutoffTimezone. */ + public handlingCutoffTimezone?: (string|null); + /** * Creates a new Shipping instance using the specified properties. * @param [properties] Properties to set @@ -4200,6 +4334,121 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a HandlingCutoffTime. */ + interface IHandlingCutoffTime { + + /** HandlingCutoffTime country */ + country?: (string|null); + + /** HandlingCutoffTime cutoffTime */ + cutoffTime?: (string|null); + + /** HandlingCutoffTime cutoffTimezone */ + cutoffTimezone?: (string|null); + + /** HandlingCutoffTime disableDeliveryAfterCutoff */ + disableDeliveryAfterCutoff?: (boolean|null); + } + + /** Represents a HandlingCutoffTime. */ + class HandlingCutoffTime implements IHandlingCutoffTime { + + /** + * Constructs a new HandlingCutoffTime. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.products.v1.IHandlingCutoffTime); + + /** HandlingCutoffTime country. */ + public country?: (string|null); + + /** HandlingCutoffTime cutoffTime. */ + public cutoffTime?: (string|null); + + /** HandlingCutoffTime cutoffTimezone. */ + public cutoffTimezone?: (string|null); + + /** HandlingCutoffTime disableDeliveryAfterCutoff. */ + public disableDeliveryAfterCutoff?: (boolean|null); + + /** + * Creates a new HandlingCutoffTime instance using the specified properties. + * @param [properties] Properties to set + * @returns HandlingCutoffTime instance + */ + public static create(properties?: google.shopping.merchant.products.v1.IHandlingCutoffTime): google.shopping.merchant.products.v1.HandlingCutoffTime; + + /** + * Encodes the specified HandlingCutoffTime message. Does not implicitly {@link google.shopping.merchant.products.v1.HandlingCutoffTime.verify|verify} messages. + * @param message HandlingCutoffTime message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.products.v1.IHandlingCutoffTime, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HandlingCutoffTime message, length delimited. Does not implicitly {@link google.shopping.merchant.products.v1.HandlingCutoffTime.verify|verify} messages. + * @param message HandlingCutoffTime message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.products.v1.IHandlingCutoffTime, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HandlingCutoffTime message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HandlingCutoffTime + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.shopping.merchant.products.v1.HandlingCutoffTime; + + /** + * Decodes a HandlingCutoffTime message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HandlingCutoffTime + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.shopping.merchant.products.v1.HandlingCutoffTime; + + /** + * Verifies a HandlingCutoffTime message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HandlingCutoffTime message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HandlingCutoffTime + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.products.v1.HandlingCutoffTime; + + /** + * Creates a plain object from a HandlingCutoffTime message. Also converts values to other types if specified. + * @param message HandlingCutoffTime + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.products.v1.HandlingCutoffTime, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HandlingCutoffTime to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HandlingCutoffTime + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Represents a ProductsService */ class ProductsService extends $protobuf.rpc.Service { @@ -9587,7 +9836,13 @@ export namespace google { LOCAL_INVENTORY_ADS = 3, FREE_LISTINGS = 4, FREE_LOCAL_LISTINGS = 5, - YOUTUBE_SHOPPING = 6 + YOUTUBE_SHOPPING = 6, + YOUTUBE_SHOPPING_CHECKOUT = 7, + YOUTUBE_AFFILIATE = 8, + FREE_VEHICLE_LISTINGS = 9, + VEHICLE_ADS = 10, + CLOUD_RETAIL = 11, + LOCAL_CLOUD_RETAIL = 12 } } @@ -9696,11 +9951,16 @@ export namespace google { LOCAL_INVENTORY_ADS = 5, VEHICLE_INVENTORY_ADS = 6, FREE_LISTINGS = 7, + FREE_LISTINGS_UCP_CHECKOUT = 19, FREE_LOCAL_LISTINGS = 8, FREE_LOCAL_VEHICLE_LISTINGS = 9, + YOUTUBE_AFFILIATE = 18, YOUTUBE_SHOPPING = 10, CLOUD_RETAIL = 11, - LOCAL_CLOUD_RETAIL = 12 + LOCAL_CLOUD_RETAIL = 12, + PRODUCT_REVIEWS = 15, + MERCHANT_REVIEWS = 16, + YOUTUBE_CHECKOUT = 17 } } diff --git a/packages/google-shopping-merchant-products/protos/protos.js b/packages/google-shopping-merchant-products/protos/protos.js index d63ab4ec313..50b272b5e7d 100644 --- a/packages/google-shopping-merchant-products/protos/protos.js +++ b/packages/google-shopping-merchant-products/protos/protos.js @@ -1405,12 +1405,14 @@ * @property {number} SUBSCRIPTION_PERIOD_UNSPECIFIED=0 SUBSCRIPTION_PERIOD_UNSPECIFIED value * @property {number} MONTH=1 MONTH value * @property {number} YEAR=2 YEAR value + * @property {number} WEEK=3 WEEK value */ v1.SubscriptionPeriod = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "SUBSCRIPTION_PERIOD_UNSPECIFIED"] = 0; values[valuesById[1] = "MONTH"] = 1; values[valuesById[2] = "YEAR"] = 2; + values[valuesById[3] = "WEEK"] = 3; return values; })(); @@ -1868,6 +1870,9 @@ * @property {google.shopping.merchant.products.v1.IShippingDimension|null} [shippingHeight] ProductAttributes shippingHeight * @property {number|Long|null} [maxHandlingTime] ProductAttributes maxHandlingTime * @property {number|Long|null} [minHandlingTime] ProductAttributes minHandlingTime + * @property {Array.|null} [shippingHandlingBusinessDays] ProductAttributes shippingHandlingBusinessDays + * @property {Array.|null} [shippingTransitBusinessDays] ProductAttributes shippingTransitBusinessDays + * @property {Array.|null} [handlingCutoffTimes] ProductAttributes handlingCutoffTimes * @property {string|null} [shippingLabel] ProductAttributes shippingLabel * @property {string|null} [transitTimeLabel] ProductAttributes transitTimeLabel * @property {string|null} [size] ProductAttributes size @@ -1931,6 +1936,9 @@ this.shipping = []; this.carrierShipping = []; this.freeShippingThreshold = []; + this.shippingHandlingBusinessDays = []; + this.shippingTransitBusinessDays = []; + this.handlingCutoffTimes = []; this.sizeTypes = []; this.adsLabels = []; this.productDetails = []; @@ -2334,6 +2342,30 @@ */ ProductAttributes.prototype.minHandlingTime = null; + /** + * ProductAttributes shippingHandlingBusinessDays. + * @member {Array.} shippingHandlingBusinessDays + * @memberof google.shopping.merchant.products.v1.ProductAttributes + * @instance + */ + ProductAttributes.prototype.shippingHandlingBusinessDays = $util.emptyArray; + + /** + * ProductAttributes shippingTransitBusinessDays. + * @member {Array.} shippingTransitBusinessDays + * @memberof google.shopping.merchant.products.v1.ProductAttributes + * @instance + */ + ProductAttributes.prototype.shippingTransitBusinessDays = $util.emptyArray; + + /** + * ProductAttributes handlingCutoffTimes. + * @member {Array.} handlingCutoffTimes + * @memberof google.shopping.merchant.products.v1.ProductAttributes + * @instance + */ + ProductAttributes.prototype.handlingCutoffTimes = $util.emptyArray; + /** * ProductAttributes shippingLabel. * @member {string|null|undefined} shippingLabel @@ -3239,9 +3271,18 @@ if (message.gtins != null && message.gtins.length) for (var i = 0; i < message.gtins.length; ++i) writer.uint32(/* id 140, wireType 2 =*/1122).string(message.gtins[i]); + if (message.handlingCutoffTimes != null && message.handlingCutoffTimes.length) + for (var i = 0; i < message.handlingCutoffTimes.length; ++i) + $root.google.shopping.merchant.products.v1.HandlingCutoffTime.encode(message.handlingCutoffTimes[i], writer.uint32(/* id 141, wireType 2 =*/1130).fork()).ldelim(); if (message.carrierShipping != null && message.carrierShipping.length) for (var i = 0; i < message.carrierShipping.length; ++i) $root.google.shopping.merchant.products.v1.ProductAttributes.CarrierShipping.encode(message.carrierShipping[i], writer.uint32(/* id 142, wireType 2 =*/1138).fork()).ldelim(); + if (message.shippingHandlingBusinessDays != null && message.shippingHandlingBusinessDays.length) + for (var i = 0; i < message.shippingHandlingBusinessDays.length; ++i) + $root.google.shopping.merchant.products.v1.ProductAttributes.ShippingBusinessDaysConfig.encode(message.shippingHandlingBusinessDays[i], writer.uint32(/* id 143, wireType 2 =*/1146).fork()).ldelim(); + if (message.shippingTransitBusinessDays != null && message.shippingTransitBusinessDays.length) + for (var i = 0; i < message.shippingTransitBusinessDays.length; ++i) + $root.google.shopping.merchant.products.v1.ProductAttributes.ShippingBusinessDaysConfig.encode(message.shippingTransitBusinessDays[i], writer.uint32(/* id 144, wireType 2 =*/1154).fork()).ldelim(); return writer; }; @@ -3484,6 +3525,24 @@ message.minHandlingTime = reader.int64(); break; } + case 143: { + if (!(message.shippingHandlingBusinessDays && message.shippingHandlingBusinessDays.length)) + message.shippingHandlingBusinessDays = []; + message.shippingHandlingBusinessDays.push($root.google.shopping.merchant.products.v1.ProductAttributes.ShippingBusinessDaysConfig.decode(reader, reader.uint32())); + break; + } + case 144: { + if (!(message.shippingTransitBusinessDays && message.shippingTransitBusinessDays.length)) + message.shippingTransitBusinessDays = []; + message.shippingTransitBusinessDays.push($root.google.shopping.merchant.products.v1.ProductAttributes.ShippingBusinessDaysConfig.decode(reader, reader.uint32())); + break; + } + case 141: { + if (!(message.handlingCutoffTimes && message.handlingCutoffTimes.length)) + message.handlingCutoffTimes = []; + message.handlingCutoffTimes.push($root.google.shopping.merchant.products.v1.HandlingCutoffTime.decode(reader, reader.uint32())); + break; + } case 46: { message.shippingLabel = reader.string(); break; @@ -4035,6 +4094,33 @@ if (!$util.isInteger(message.minHandlingTime) && !(message.minHandlingTime && $util.isInteger(message.minHandlingTime.low) && $util.isInteger(message.minHandlingTime.high))) return "minHandlingTime: integer|Long expected"; } + if (message.shippingHandlingBusinessDays != null && message.hasOwnProperty("shippingHandlingBusinessDays")) { + if (!Array.isArray(message.shippingHandlingBusinessDays)) + return "shippingHandlingBusinessDays: array expected"; + for (var i = 0; i < message.shippingHandlingBusinessDays.length; ++i) { + var error = $root.google.shopping.merchant.products.v1.ProductAttributes.ShippingBusinessDaysConfig.verify(message.shippingHandlingBusinessDays[i]); + if (error) + return "shippingHandlingBusinessDays." + error; + } + } + if (message.shippingTransitBusinessDays != null && message.hasOwnProperty("shippingTransitBusinessDays")) { + if (!Array.isArray(message.shippingTransitBusinessDays)) + return "shippingTransitBusinessDays: array expected"; + for (var i = 0; i < message.shippingTransitBusinessDays.length; ++i) { + var error = $root.google.shopping.merchant.products.v1.ProductAttributes.ShippingBusinessDaysConfig.verify(message.shippingTransitBusinessDays[i]); + if (error) + return "shippingTransitBusinessDays." + error; + } + } + if (message.handlingCutoffTimes != null && message.hasOwnProperty("handlingCutoffTimes")) { + if (!Array.isArray(message.handlingCutoffTimes)) + return "handlingCutoffTimes: array expected"; + for (var i = 0; i < message.handlingCutoffTimes.length; ++i) { + var error = $root.google.shopping.merchant.products.v1.HandlingCutoffTime.verify(message.handlingCutoffTimes[i]); + if (error) + return "handlingCutoffTimes." + error; + } + } if (message.shippingLabel != null && message.hasOwnProperty("shippingLabel")) { properties._shippingLabel = 1; if (!$util.isString(message.shippingLabel)) @@ -4310,6 +4396,12 @@ case 4: case 5: case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: break; } } @@ -4327,6 +4419,12 @@ case 4: case 5: case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: break; } } @@ -4750,6 +4848,36 @@ message.minHandlingTime = object.minHandlingTime; else if (typeof object.minHandlingTime === "object") message.minHandlingTime = new $util.LongBits(object.minHandlingTime.low >>> 0, object.minHandlingTime.high >>> 0).toNumber(); + if (object.shippingHandlingBusinessDays) { + if (!Array.isArray(object.shippingHandlingBusinessDays)) + throw TypeError(".google.shopping.merchant.products.v1.ProductAttributes.shippingHandlingBusinessDays: array expected"); + message.shippingHandlingBusinessDays = []; + for (var i = 0; i < object.shippingHandlingBusinessDays.length; ++i) { + if (typeof object.shippingHandlingBusinessDays[i] !== "object") + throw TypeError(".google.shopping.merchant.products.v1.ProductAttributes.shippingHandlingBusinessDays: object expected"); + message.shippingHandlingBusinessDays[i] = $root.google.shopping.merchant.products.v1.ProductAttributes.ShippingBusinessDaysConfig.fromObject(object.shippingHandlingBusinessDays[i]); + } + } + if (object.shippingTransitBusinessDays) { + if (!Array.isArray(object.shippingTransitBusinessDays)) + throw TypeError(".google.shopping.merchant.products.v1.ProductAttributes.shippingTransitBusinessDays: array expected"); + message.shippingTransitBusinessDays = []; + for (var i = 0; i < object.shippingTransitBusinessDays.length; ++i) { + if (typeof object.shippingTransitBusinessDays[i] !== "object") + throw TypeError(".google.shopping.merchant.products.v1.ProductAttributes.shippingTransitBusinessDays: object expected"); + message.shippingTransitBusinessDays[i] = $root.google.shopping.merchant.products.v1.ProductAttributes.ShippingBusinessDaysConfig.fromObject(object.shippingTransitBusinessDays[i]); + } + } + if (object.handlingCutoffTimes) { + if (!Array.isArray(object.handlingCutoffTimes)) + throw TypeError(".google.shopping.merchant.products.v1.ProductAttributes.handlingCutoffTimes: array expected"); + message.handlingCutoffTimes = []; + for (var i = 0; i < object.handlingCutoffTimes.length; ++i) { + if (typeof object.handlingCutoffTimes[i] !== "object") + throw TypeError(".google.shopping.merchant.products.v1.ProductAttributes.handlingCutoffTimes: object expected"); + message.handlingCutoffTimes[i] = $root.google.shopping.merchant.products.v1.HandlingCutoffTime.fromObject(object.handlingCutoffTimes[i]); + } + } if (object.shippingLabel != null) message.shippingLabel = String(object.shippingLabel); if (object.transitTimeLabel != null) @@ -5208,6 +5336,30 @@ case 6: message.includedDestinations[i] = 6; break; + case "YOUTUBE_SHOPPING_CHECKOUT": + case 7: + message.includedDestinations[i] = 7; + break; + case "YOUTUBE_AFFILIATE": + case 8: + message.includedDestinations[i] = 8; + break; + case "FREE_VEHICLE_LISTINGS": + case 9: + message.includedDestinations[i] = 9; + break; + case "VEHICLE_ADS": + case 10: + message.includedDestinations[i] = 10; + break; + case "CLOUD_RETAIL": + case 11: + message.includedDestinations[i] = 11; + break; + case "LOCAL_CLOUD_RETAIL": + case 12: + message.includedDestinations[i] = 12; + break; } } if (object.excludedDestinations) { @@ -5249,6 +5401,30 @@ case 6: message.excludedDestinations[i] = 6; break; + case "YOUTUBE_SHOPPING_CHECKOUT": + case 7: + message.excludedDestinations[i] = 7; + break; + case "YOUTUBE_AFFILIATE": + case 8: + message.excludedDestinations[i] = 8; + break; + case "FREE_VEHICLE_LISTINGS": + case 9: + message.excludedDestinations[i] = 9; + break; + case "VEHICLE_ADS": + case 10: + message.excludedDestinations[i] = 10; + break; + case "CLOUD_RETAIL": + case 11: + message.excludedDestinations[i] = 11; + break; + case "LOCAL_CLOUD_RETAIL": + case 12: + message.excludedDestinations[i] = 12; + break; } } if (object.shoppingAdsExcludedCountries) { @@ -5370,7 +5546,10 @@ object.loyaltyPrograms = []; object.sustainabilityIncentives = []; object.gtins = []; + object.handlingCutoffTimes = []; object.carrierShipping = []; + object.shippingHandlingBusinessDays = []; + object.shippingTransitBusinessDays = []; } if (options.defaults) { object.expirationDate = null; @@ -5802,11 +5981,26 @@ for (var j = 0; j < message.gtins.length; ++j) object.gtins[j] = message.gtins[j]; } + if (message.handlingCutoffTimes && message.handlingCutoffTimes.length) { + object.handlingCutoffTimes = []; + for (var j = 0; j < message.handlingCutoffTimes.length; ++j) + object.handlingCutoffTimes[j] = $root.google.shopping.merchant.products.v1.HandlingCutoffTime.toObject(message.handlingCutoffTimes[j], options); + } if (message.carrierShipping && message.carrierShipping.length) { object.carrierShipping = []; for (var j = 0; j < message.carrierShipping.length; ++j) object.carrierShipping[j] = $root.google.shopping.merchant.products.v1.ProductAttributes.CarrierShipping.toObject(message.carrierShipping[j], options); } + if (message.shippingHandlingBusinessDays && message.shippingHandlingBusinessDays.length) { + object.shippingHandlingBusinessDays = []; + for (var j = 0; j < message.shippingHandlingBusinessDays.length; ++j) + object.shippingHandlingBusinessDays[j] = $root.google.shopping.merchant.products.v1.ProductAttributes.ShippingBusinessDaysConfig.toObject(message.shippingHandlingBusinessDays[j], options); + } + if (message.shippingTransitBusinessDays && message.shippingTransitBusinessDays.length) { + object.shippingTransitBusinessDays = []; + for (var j = 0; j < message.shippingTransitBusinessDays.length; ++j) + object.shippingTransitBusinessDays[j] = $root.google.shopping.merchant.products.v1.ProductAttributes.ShippingBusinessDaysConfig.toObject(message.shippingTransitBusinessDays[j], options); + } return object; }; @@ -5836,6 +6030,257 @@ return typeUrlPrefix + "/google.shopping.merchant.products.v1.ProductAttributes"; }; + ProductAttributes.ShippingBusinessDaysConfig = (function() { + + /** + * Properties of a ShippingBusinessDaysConfig. + * @memberof google.shopping.merchant.products.v1.ProductAttributes + * @interface IShippingBusinessDaysConfig + * @property {string|null} [country] ShippingBusinessDaysConfig country + * @property {string|null} [businessDays] ShippingBusinessDaysConfig businessDays + */ + + /** + * Constructs a new ShippingBusinessDaysConfig. + * @memberof google.shopping.merchant.products.v1.ProductAttributes + * @classdesc Represents a ShippingBusinessDaysConfig. + * @implements IShippingBusinessDaysConfig + * @constructor + * @param {google.shopping.merchant.products.v1.ProductAttributes.IShippingBusinessDaysConfig=} [properties] Properties to set + */ + function ShippingBusinessDaysConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ShippingBusinessDaysConfig country. + * @member {string|null|undefined} country + * @memberof google.shopping.merchant.products.v1.ProductAttributes.ShippingBusinessDaysConfig + * @instance + */ + ShippingBusinessDaysConfig.prototype.country = null; + + /** + * ShippingBusinessDaysConfig businessDays. + * @member {string|null|undefined} businessDays + * @memberof google.shopping.merchant.products.v1.ProductAttributes.ShippingBusinessDaysConfig + * @instance + */ + ShippingBusinessDaysConfig.prototype.businessDays = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ShippingBusinessDaysConfig.prototype, "_country", { + get: $util.oneOfGetter($oneOfFields = ["country"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ShippingBusinessDaysConfig.prototype, "_businessDays", { + get: $util.oneOfGetter($oneOfFields = ["businessDays"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ShippingBusinessDaysConfig instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.products.v1.ProductAttributes.ShippingBusinessDaysConfig + * @static + * @param {google.shopping.merchant.products.v1.ProductAttributes.IShippingBusinessDaysConfig=} [properties] Properties to set + * @returns {google.shopping.merchant.products.v1.ProductAttributes.ShippingBusinessDaysConfig} ShippingBusinessDaysConfig instance + */ + ShippingBusinessDaysConfig.create = function create(properties) { + return new ShippingBusinessDaysConfig(properties); + }; + + /** + * Encodes the specified ShippingBusinessDaysConfig message. Does not implicitly {@link google.shopping.merchant.products.v1.ProductAttributes.ShippingBusinessDaysConfig.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.products.v1.ProductAttributes.ShippingBusinessDaysConfig + * @static + * @param {google.shopping.merchant.products.v1.ProductAttributes.IShippingBusinessDaysConfig} message ShippingBusinessDaysConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShippingBusinessDaysConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.country != null && Object.hasOwnProperty.call(message, "country")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.country); + if (message.businessDays != null && Object.hasOwnProperty.call(message, "businessDays")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.businessDays); + return writer; + }; + + /** + * Encodes the specified ShippingBusinessDaysConfig message, length delimited. Does not implicitly {@link google.shopping.merchant.products.v1.ProductAttributes.ShippingBusinessDaysConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.products.v1.ProductAttributes.ShippingBusinessDaysConfig + * @static + * @param {google.shopping.merchant.products.v1.ProductAttributes.IShippingBusinessDaysConfig} message ShippingBusinessDaysConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShippingBusinessDaysConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ShippingBusinessDaysConfig message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.products.v1.ProductAttributes.ShippingBusinessDaysConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.shopping.merchant.products.v1.ProductAttributes.ShippingBusinessDaysConfig} ShippingBusinessDaysConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShippingBusinessDaysConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.shopping.merchant.products.v1.ProductAttributes.ShippingBusinessDaysConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.country = reader.string(); + break; + } + case 2: { + message.businessDays = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ShippingBusinessDaysConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.products.v1.ProductAttributes.ShippingBusinessDaysConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.products.v1.ProductAttributes.ShippingBusinessDaysConfig} ShippingBusinessDaysConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShippingBusinessDaysConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ShippingBusinessDaysConfig message. + * @function verify + * @memberof google.shopping.merchant.products.v1.ProductAttributes.ShippingBusinessDaysConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ShippingBusinessDaysConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.country != null && message.hasOwnProperty("country")) { + properties._country = 1; + if (!$util.isString(message.country)) + return "country: string expected"; + } + if (message.businessDays != null && message.hasOwnProperty("businessDays")) { + properties._businessDays = 1; + if (!$util.isString(message.businessDays)) + return "businessDays: string expected"; + } + return null; + }; + + /** + * Creates a ShippingBusinessDaysConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.products.v1.ProductAttributes.ShippingBusinessDaysConfig + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.products.v1.ProductAttributes.ShippingBusinessDaysConfig} ShippingBusinessDaysConfig + */ + ShippingBusinessDaysConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.products.v1.ProductAttributes.ShippingBusinessDaysConfig) + return object; + var message = new $root.google.shopping.merchant.products.v1.ProductAttributes.ShippingBusinessDaysConfig(); + if (object.country != null) + message.country = String(object.country); + if (object.businessDays != null) + message.businessDays = String(object.businessDays); + return message; + }; + + /** + * Creates a plain object from a ShippingBusinessDaysConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.products.v1.ProductAttributes.ShippingBusinessDaysConfig + * @static + * @param {google.shopping.merchant.products.v1.ProductAttributes.ShippingBusinessDaysConfig} message ShippingBusinessDaysConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ShippingBusinessDaysConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.country != null && message.hasOwnProperty("country")) { + object.country = message.country; + if (options.oneofs) + object._country = "country"; + } + if (message.businessDays != null && message.hasOwnProperty("businessDays")) { + object.businessDays = message.businessDays; + if (options.oneofs) + object._businessDays = "businessDays"; + } + return object; + }; + + /** + * Converts this ShippingBusinessDaysConfig to JSON. + * @function toJSON + * @memberof google.shopping.merchant.products.v1.ProductAttributes.ShippingBusinessDaysConfig + * @instance + * @returns {Object.} JSON object + */ + ShippingBusinessDaysConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ShippingBusinessDaysConfig + * @function getTypeUrl + * @memberof google.shopping.merchant.products.v1.ProductAttributes.ShippingBusinessDaysConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShippingBusinessDaysConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.products.v1.ProductAttributes.ShippingBusinessDaysConfig"; + }; + + return ShippingBusinessDaysConfig; + })(); + ProductAttributes.CarrierShipping = (function() { /** @@ -8267,6 +8712,7 @@ case 0: case 1: case 2: + case 3: break; } if (message.periodLength != null && message.hasOwnProperty("periodLength")) @@ -8311,6 +8757,10 @@ case 2: message.period = 2; break; + case "WEEK": + case 3: + message.period = 3; + break; } if (object.periodLength != null) if ($util.Long) @@ -9467,6 +9917,8 @@ * @property {number|Long|null} [maxHandlingTime] Shipping maxHandlingTime * @property {number|Long|null} [minTransitTime] Shipping minTransitTime * @property {number|Long|null} [maxTransitTime] Shipping maxTransitTime + * @property {string|null} [handlingCutoffTime] Shipping handlingCutoffTime + * @property {string|null} [handlingCutoffTimezone] Shipping handlingCutoffTimezone */ /** @@ -9572,6 +10024,22 @@ */ Shipping.prototype.maxTransitTime = null; + /** + * Shipping handlingCutoffTime. + * @member {string|null|undefined} handlingCutoffTime + * @memberof google.shopping.merchant.products.v1.Shipping + * @instance + */ + Shipping.prototype.handlingCutoffTime = null; + + /** + * Shipping handlingCutoffTimezone. + * @member {string|null|undefined} handlingCutoffTimezone + * @memberof google.shopping.merchant.products.v1.Shipping + * @instance + */ + Shipping.prototype.handlingCutoffTimezone = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -9599,6 +10067,18 @@ set: $util.oneOfSetter($oneOfFields) }); + // Virtual OneOf for proto3 optional field + Object.defineProperty(Shipping.prototype, "_handlingCutoffTime", { + get: $util.oneOfGetter($oneOfFields = ["handlingCutoffTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Shipping.prototype, "_handlingCutoffTimezone", { + get: $util.oneOfGetter($oneOfFields = ["handlingCutoffTimezone"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new Shipping instance using the specified properties. * @function create @@ -9645,6 +10125,10 @@ writer.uint32(/* id 10, wireType 0 =*/80).int64(message.minTransitTime); if (message.maxTransitTime != null && Object.hasOwnProperty.call(message, "maxTransitTime")) writer.uint32(/* id 11, wireType 0 =*/88).int64(message.maxTransitTime); + if (message.handlingCutoffTime != null && Object.hasOwnProperty.call(message, "handlingCutoffTime")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.handlingCutoffTime); + if (message.handlingCutoffTimezone != null && Object.hasOwnProperty.call(message, "handlingCutoffTimezone")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.handlingCutoffTimezone); return writer; }; @@ -9725,6 +10209,14 @@ message.maxTransitTime = reader.int64(); break; } + case 12: { + message.handlingCutoffTime = reader.string(); + break; + } + case 13: { + message.handlingCutoffTimezone = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -9804,6 +10296,16 @@ if (!$util.isInteger(message.maxTransitTime) && !(message.maxTransitTime && $util.isInteger(message.maxTransitTime.low) && $util.isInteger(message.maxTransitTime.high))) return "maxTransitTime: integer|Long expected"; } + if (message.handlingCutoffTime != null && message.hasOwnProperty("handlingCutoffTime")) { + properties._handlingCutoffTime = 1; + if (!$util.isString(message.handlingCutoffTime)) + return "handlingCutoffTime: string expected"; + } + if (message.handlingCutoffTimezone != null && message.hasOwnProperty("handlingCutoffTimezone")) { + properties._handlingCutoffTimezone = 1; + if (!$util.isString(message.handlingCutoffTimezone)) + return "handlingCutoffTimezone: string expected"; + } return null; }; @@ -9879,6 +10381,10 @@ message.maxTransitTime = object.maxTransitTime; else if (typeof object.maxTransitTime === "object") message.maxTransitTime = new $util.LongBits(object.maxTransitTime.low >>> 0, object.maxTransitTime.high >>> 0).toNumber(); + if (object.handlingCutoffTime != null) + message.handlingCutoffTime = String(object.handlingCutoffTime); + if (object.handlingCutoffTimezone != null) + message.handlingCutoffTimezone = String(object.handlingCutoffTimezone); return message; }; @@ -9957,6 +10463,16 @@ if (options.oneofs) object._maxTransitTime = "maxTransitTime"; } + if (message.handlingCutoffTime != null && message.hasOwnProperty("handlingCutoffTime")) { + object.handlingCutoffTime = message.handlingCutoffTime; + if (options.oneofs) + object._handlingCutoffTime = "handlingCutoffTime"; + } + if (message.handlingCutoffTimezone != null && message.hasOwnProperty("handlingCutoffTimezone")) { + object.handlingCutoffTimezone = message.handlingCutoffTimezone; + if (options.oneofs) + object._handlingCutoffTimezone = "handlingCutoffTimezone"; + } return object; }; @@ -12459,11 +12975,16 @@ case 5: case 6: case 7: + case 19: case 8: case 9: + case 18: case 10: case 11: case 12: + case 15: + case 16: + case 17: break; } if (message.approvedCountries != null && message.hasOwnProperty("approvedCountries")) { @@ -12549,6 +13070,10 @@ case 7: message.reportingContext = 7; break; + case "FREE_LISTINGS_UCP_CHECKOUT": + case 19: + message.reportingContext = 19; + break; case "FREE_LOCAL_LISTINGS": case 8: message.reportingContext = 8; @@ -12557,6 +13082,10 @@ case 9: message.reportingContext = 9; break; + case "YOUTUBE_AFFILIATE": + case 18: + message.reportingContext = 18; + break; case "YOUTUBE_SHOPPING": case 10: message.reportingContext = 10; @@ -12565,9 +13094,21 @@ case 11: message.reportingContext = 11; break; - case "LOCAL_CLOUD_RETAIL": - case 12: - message.reportingContext = 12; + case "LOCAL_CLOUD_RETAIL": + case 12: + message.reportingContext = 12; + break; + case "PRODUCT_REVIEWS": + case 15: + message.reportingContext = 15; + break; + case "MERCHANT_REVIEWS": + case 16: + message.reportingContext = 16; + break; + case "YOUTUBE_CHECKOUT": + case 17: + message.reportingContext = 17; break; } if (object.approvedCountries) { @@ -12953,11 +13494,16 @@ case 5: case 6: case 7: + case 19: case 8: case 9: + case 18: case 10: case 11: case 12: + case 15: + case 16: + case 17: break; } if (message.description != null && message.hasOwnProperty("description")) @@ -13068,6 +13614,10 @@ case 7: message.reportingContext = 7; break; + case "FREE_LISTINGS_UCP_CHECKOUT": + case 19: + message.reportingContext = 19; + break; case "FREE_LOCAL_LISTINGS": case 8: message.reportingContext = 8; @@ -13076,6 +13626,10 @@ case 9: message.reportingContext = 9; break; + case "YOUTUBE_AFFILIATE": + case 18: + message.reportingContext = 18; + break; case "YOUTUBE_SHOPPING": case 10: message.reportingContext = 10; @@ -13088,6 +13642,18 @@ case 12: message.reportingContext = 12; break; + case "PRODUCT_REVIEWS": + case 15: + message.reportingContext = 15; + break; + case "MERCHANT_REVIEWS": + case 16: + message.reportingContext = 16; + break; + case "YOUTUBE_CHECKOUT": + case 17: + message.reportingContext = 17; + break; } if (object.description != null) message.description = String(object.description); @@ -14297,6 +14863,323 @@ return AutomatedDiscounts; })(); + v1.HandlingCutoffTime = (function() { + + /** + * Properties of a HandlingCutoffTime. + * @memberof google.shopping.merchant.products.v1 + * @interface IHandlingCutoffTime + * @property {string|null} [country] HandlingCutoffTime country + * @property {string|null} [cutoffTime] HandlingCutoffTime cutoffTime + * @property {string|null} [cutoffTimezone] HandlingCutoffTime cutoffTimezone + * @property {boolean|null} [disableDeliveryAfterCutoff] HandlingCutoffTime disableDeliveryAfterCutoff + */ + + /** + * Constructs a new HandlingCutoffTime. + * @memberof google.shopping.merchant.products.v1 + * @classdesc Represents a HandlingCutoffTime. + * @implements IHandlingCutoffTime + * @constructor + * @param {google.shopping.merchant.products.v1.IHandlingCutoffTime=} [properties] Properties to set + */ + function HandlingCutoffTime(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HandlingCutoffTime country. + * @member {string|null|undefined} country + * @memberof google.shopping.merchant.products.v1.HandlingCutoffTime + * @instance + */ + HandlingCutoffTime.prototype.country = null; + + /** + * HandlingCutoffTime cutoffTime. + * @member {string|null|undefined} cutoffTime + * @memberof google.shopping.merchant.products.v1.HandlingCutoffTime + * @instance + */ + HandlingCutoffTime.prototype.cutoffTime = null; + + /** + * HandlingCutoffTime cutoffTimezone. + * @member {string|null|undefined} cutoffTimezone + * @memberof google.shopping.merchant.products.v1.HandlingCutoffTime + * @instance + */ + HandlingCutoffTime.prototype.cutoffTimezone = null; + + /** + * HandlingCutoffTime disableDeliveryAfterCutoff. + * @member {boolean|null|undefined} disableDeliveryAfterCutoff + * @memberof google.shopping.merchant.products.v1.HandlingCutoffTime + * @instance + */ + HandlingCutoffTime.prototype.disableDeliveryAfterCutoff = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HandlingCutoffTime.prototype, "_country", { + get: $util.oneOfGetter($oneOfFields = ["country"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HandlingCutoffTime.prototype, "_cutoffTime", { + get: $util.oneOfGetter($oneOfFields = ["cutoffTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HandlingCutoffTime.prototype, "_cutoffTimezone", { + get: $util.oneOfGetter($oneOfFields = ["cutoffTimezone"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HandlingCutoffTime.prototype, "_disableDeliveryAfterCutoff", { + get: $util.oneOfGetter($oneOfFields = ["disableDeliveryAfterCutoff"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HandlingCutoffTime instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.products.v1.HandlingCutoffTime + * @static + * @param {google.shopping.merchant.products.v1.IHandlingCutoffTime=} [properties] Properties to set + * @returns {google.shopping.merchant.products.v1.HandlingCutoffTime} HandlingCutoffTime instance + */ + HandlingCutoffTime.create = function create(properties) { + return new HandlingCutoffTime(properties); + }; + + /** + * Encodes the specified HandlingCutoffTime message. Does not implicitly {@link google.shopping.merchant.products.v1.HandlingCutoffTime.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.products.v1.HandlingCutoffTime + * @static + * @param {google.shopping.merchant.products.v1.IHandlingCutoffTime} message HandlingCutoffTime message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HandlingCutoffTime.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.country != null && Object.hasOwnProperty.call(message, "country")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.country); + if (message.cutoffTime != null && Object.hasOwnProperty.call(message, "cutoffTime")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.cutoffTime); + if (message.cutoffTimezone != null && Object.hasOwnProperty.call(message, "cutoffTimezone")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.cutoffTimezone); + if (message.disableDeliveryAfterCutoff != null && Object.hasOwnProperty.call(message, "disableDeliveryAfterCutoff")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.disableDeliveryAfterCutoff); + return writer; + }; + + /** + * Encodes the specified HandlingCutoffTime message, length delimited. Does not implicitly {@link google.shopping.merchant.products.v1.HandlingCutoffTime.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.products.v1.HandlingCutoffTime + * @static + * @param {google.shopping.merchant.products.v1.IHandlingCutoffTime} message HandlingCutoffTime message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HandlingCutoffTime.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HandlingCutoffTime message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.products.v1.HandlingCutoffTime + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.shopping.merchant.products.v1.HandlingCutoffTime} HandlingCutoffTime + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HandlingCutoffTime.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.shopping.merchant.products.v1.HandlingCutoffTime(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.country = reader.string(); + break; + } + case 2: { + message.cutoffTime = reader.string(); + break; + } + case 3: { + message.cutoffTimezone = reader.string(); + break; + } + case 4: { + message.disableDeliveryAfterCutoff = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HandlingCutoffTime message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.products.v1.HandlingCutoffTime + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.products.v1.HandlingCutoffTime} HandlingCutoffTime + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HandlingCutoffTime.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HandlingCutoffTime message. + * @function verify + * @memberof google.shopping.merchant.products.v1.HandlingCutoffTime + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HandlingCutoffTime.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.country != null && message.hasOwnProperty("country")) { + properties._country = 1; + if (!$util.isString(message.country)) + return "country: string expected"; + } + if (message.cutoffTime != null && message.hasOwnProperty("cutoffTime")) { + properties._cutoffTime = 1; + if (!$util.isString(message.cutoffTime)) + return "cutoffTime: string expected"; + } + if (message.cutoffTimezone != null && message.hasOwnProperty("cutoffTimezone")) { + properties._cutoffTimezone = 1; + if (!$util.isString(message.cutoffTimezone)) + return "cutoffTimezone: string expected"; + } + if (message.disableDeliveryAfterCutoff != null && message.hasOwnProperty("disableDeliveryAfterCutoff")) { + properties._disableDeliveryAfterCutoff = 1; + if (typeof message.disableDeliveryAfterCutoff !== "boolean") + return "disableDeliveryAfterCutoff: boolean expected"; + } + return null; + }; + + /** + * Creates a HandlingCutoffTime message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.products.v1.HandlingCutoffTime + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.products.v1.HandlingCutoffTime} HandlingCutoffTime + */ + HandlingCutoffTime.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.products.v1.HandlingCutoffTime) + return object; + var message = new $root.google.shopping.merchant.products.v1.HandlingCutoffTime(); + if (object.country != null) + message.country = String(object.country); + if (object.cutoffTime != null) + message.cutoffTime = String(object.cutoffTime); + if (object.cutoffTimezone != null) + message.cutoffTimezone = String(object.cutoffTimezone); + if (object.disableDeliveryAfterCutoff != null) + message.disableDeliveryAfterCutoff = Boolean(object.disableDeliveryAfterCutoff); + return message; + }; + + /** + * Creates a plain object from a HandlingCutoffTime message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.products.v1.HandlingCutoffTime + * @static + * @param {google.shopping.merchant.products.v1.HandlingCutoffTime} message HandlingCutoffTime + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HandlingCutoffTime.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.country != null && message.hasOwnProperty("country")) { + object.country = message.country; + if (options.oneofs) + object._country = "country"; + } + if (message.cutoffTime != null && message.hasOwnProperty("cutoffTime")) { + object.cutoffTime = message.cutoffTime; + if (options.oneofs) + object._cutoffTime = "cutoffTime"; + } + if (message.cutoffTimezone != null && message.hasOwnProperty("cutoffTimezone")) { + object.cutoffTimezone = message.cutoffTimezone; + if (options.oneofs) + object._cutoffTimezone = "cutoffTimezone"; + } + if (message.disableDeliveryAfterCutoff != null && message.hasOwnProperty("disableDeliveryAfterCutoff")) { + object.disableDeliveryAfterCutoff = message.disableDeliveryAfterCutoff; + if (options.oneofs) + object._disableDeliveryAfterCutoff = "disableDeliveryAfterCutoff"; + } + return object; + }; + + /** + * Converts this HandlingCutoffTime to JSON. + * @function toJSON + * @memberof google.shopping.merchant.products.v1.HandlingCutoffTime + * @instance + * @returns {Object.} JSON object + */ + HandlingCutoffTime.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HandlingCutoffTime + * @function getTypeUrl + * @memberof google.shopping.merchant.products.v1.HandlingCutoffTime + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HandlingCutoffTime.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.products.v1.HandlingCutoffTime"; + }; + + return HandlingCutoffTime; + })(); + v1.ProductsService = (function() { /** @@ -25886,11 +26769,16 @@ case 5: case 6: case 7: + case 19: case 8: case 9: + case 18: case 10: case 11: case 12: + case 15: + case 16: + case 17: break; } if (message.approvedCountries != null && message.hasOwnProperty("approvedCountries")) { @@ -25976,6 +26864,10 @@ case 7: message.reportingContext = 7; break; + case "FREE_LISTINGS_UCP_CHECKOUT": + case 19: + message.reportingContext = 19; + break; case "FREE_LOCAL_LISTINGS": case 8: message.reportingContext = 8; @@ -25984,6 +26876,10 @@ case 9: message.reportingContext = 9; break; + case "YOUTUBE_AFFILIATE": + case 18: + message.reportingContext = 18; + break; case "YOUTUBE_SHOPPING": case 10: message.reportingContext = 10; @@ -25996,6 +26892,18 @@ case 12: message.reportingContext = 12; break; + case "PRODUCT_REVIEWS": + case 15: + message.reportingContext = 15; + break; + case "MERCHANT_REVIEWS": + case 16: + message.reportingContext = 16; + break; + case "YOUTUBE_CHECKOUT": + case 17: + message.reportingContext = 17; + break; } if (object.approvedCountries) { if (!Array.isArray(object.approvedCountries)) @@ -26380,11 +27288,16 @@ case 5: case 6: case 7: + case 19: case 8: case 9: + case 18: case 10: case 11: case 12: + case 15: + case 16: + case 17: break; } if (message.description != null && message.hasOwnProperty("description")) @@ -26495,6 +27408,10 @@ case 7: message.reportingContext = 7; break; + case "FREE_LISTINGS_UCP_CHECKOUT": + case 19: + message.reportingContext = 19; + break; case "FREE_LOCAL_LISTINGS": case 8: message.reportingContext = 8; @@ -26503,6 +27420,10 @@ case 9: message.reportingContext = 9; break; + case "YOUTUBE_AFFILIATE": + case 18: + message.reportingContext = 18; + break; case "YOUTUBE_SHOPPING": case 10: message.reportingContext = 10; @@ -26515,6 +27436,18 @@ case 12: message.reportingContext = 12; break; + case "PRODUCT_REVIEWS": + case 15: + message.reportingContext = 15; + break; + case "MERCHANT_REVIEWS": + case 16: + message.reportingContext = 16; + break; + case "YOUTUBE_CHECKOUT": + case 17: + message.reportingContext = 17; + break; } if (object.description != null) message.description = String(object.description); @@ -30105,6 +31038,12 @@ * @property {number} FREE_LISTINGS=4 FREE_LISTINGS value * @property {number} FREE_LOCAL_LISTINGS=5 FREE_LOCAL_LISTINGS value * @property {number} YOUTUBE_SHOPPING=6 YOUTUBE_SHOPPING value + * @property {number} YOUTUBE_SHOPPING_CHECKOUT=7 YOUTUBE_SHOPPING_CHECKOUT value + * @property {number} YOUTUBE_AFFILIATE=8 YOUTUBE_AFFILIATE value + * @property {number} FREE_VEHICLE_LISTINGS=9 FREE_VEHICLE_LISTINGS value + * @property {number} VEHICLE_ADS=10 VEHICLE_ADS value + * @property {number} CLOUD_RETAIL=11 CLOUD_RETAIL value + * @property {number} LOCAL_CLOUD_RETAIL=12 LOCAL_CLOUD_RETAIL value */ Destination.DestinationEnum = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -30115,6 +31054,12 @@ values[valuesById[4] = "FREE_LISTINGS"] = 4; values[valuesById[5] = "FREE_LOCAL_LISTINGS"] = 5; values[valuesById[6] = "YOUTUBE_SHOPPING"] = 6; + values[valuesById[7] = "YOUTUBE_SHOPPING_CHECKOUT"] = 7; + values[valuesById[8] = "YOUTUBE_AFFILIATE"] = 8; + values[valuesById[9] = "FREE_VEHICLE_LISTINGS"] = 9; + values[valuesById[10] = "VEHICLE_ADS"] = 10; + values[valuesById[11] = "CLOUD_RETAIL"] = 11; + values[valuesById[12] = "LOCAL_CLOUD_RETAIL"] = 12; return values; })(); @@ -30309,11 +31254,16 @@ * @property {number} LOCAL_INVENTORY_ADS=5 LOCAL_INVENTORY_ADS value * @property {number} VEHICLE_INVENTORY_ADS=6 VEHICLE_INVENTORY_ADS value * @property {number} FREE_LISTINGS=7 FREE_LISTINGS value + * @property {number} FREE_LISTINGS_UCP_CHECKOUT=19 FREE_LISTINGS_UCP_CHECKOUT value * @property {number} FREE_LOCAL_LISTINGS=8 FREE_LOCAL_LISTINGS value * @property {number} FREE_LOCAL_VEHICLE_LISTINGS=9 FREE_LOCAL_VEHICLE_LISTINGS value + * @property {number} YOUTUBE_AFFILIATE=18 YOUTUBE_AFFILIATE value * @property {number} YOUTUBE_SHOPPING=10 YOUTUBE_SHOPPING value * @property {number} CLOUD_RETAIL=11 CLOUD_RETAIL value * @property {number} LOCAL_CLOUD_RETAIL=12 LOCAL_CLOUD_RETAIL value + * @property {number} PRODUCT_REVIEWS=15 PRODUCT_REVIEWS value + * @property {number} MERCHANT_REVIEWS=16 MERCHANT_REVIEWS value + * @property {number} YOUTUBE_CHECKOUT=17 YOUTUBE_CHECKOUT value */ ReportingContext.ReportingContextEnum = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -30327,11 +31277,16 @@ values[valuesById[5] = "LOCAL_INVENTORY_ADS"] = 5; values[valuesById[6] = "VEHICLE_INVENTORY_ADS"] = 6; values[valuesById[7] = "FREE_LISTINGS"] = 7; + values[valuesById[19] = "FREE_LISTINGS_UCP_CHECKOUT"] = 19; values[valuesById[8] = "FREE_LOCAL_LISTINGS"] = 8; values[valuesById[9] = "FREE_LOCAL_VEHICLE_LISTINGS"] = 9; + values[valuesById[18] = "YOUTUBE_AFFILIATE"] = 18; values[valuesById[10] = "YOUTUBE_SHOPPING"] = 10; values[valuesById[11] = "CLOUD_RETAIL"] = 11; values[valuesById[12] = "LOCAL_CLOUD_RETAIL"] = 12; + values[valuesById[15] = "PRODUCT_REVIEWS"] = 15; + values[valuesById[16] = "MERCHANT_REVIEWS"] = 16; + values[valuesById[17] = "YOUTUBE_CHECKOUT"] = 17; return values; })(); diff --git a/packages/google-shopping-merchant-products/protos/protos.json b/packages/google-shopping-merchant-products/protos/protos.json index 35150e9158f..55d003c51bc 100644 --- a/packages/google-shopping-merchant-products/protos/protos.json +++ b/packages/google-shopping-merchant-products/protos/protos.json @@ -239,7 +239,8 @@ "values": { "SUBSCRIPTION_PERIOD_UNSPECIFIED": 0, "MONTH": 1, - "YEAR": 2 + "YEAR": 2, + "WEEK": 3 } }, "AgeGroup": { @@ -954,6 +955,21 @@ "proto3_optional": true } }, + "shippingHandlingBusinessDays": { + "rule": "repeated", + "type": "ShippingBusinessDaysConfig", + "id": 143 + }, + "shippingTransitBusinessDays": { + "rule": "repeated", + "type": "ShippingBusinessDaysConfig", + "id": 144 + }, + "handlingCutoffTimes": { + "rule": "repeated", + "type": "HandlingCutoffTime", + "id": 141 + }, "shippingLabel": { "type": "string", "id": 46, @@ -1233,6 +1249,36 @@ } }, "nested": { + "ShippingBusinessDaysConfig": { + "oneofs": { + "_country": { + "oneof": [ + "country" + ] + }, + "_businessDays": { + "oneof": [ + "businessDays" + ] + } + }, + "fields": { + "country": { + "type": "string", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "businessDays": { + "type": "string", + "id": 2, + "options": { + "proto3_optional": true + } + } + } + }, "CarrierShipping": { "oneofs": { "_country": { @@ -1692,6 +1738,16 @@ "oneof": [ "maxTransitTime" ] + }, + "_handlingCutoffTime": { + "oneof": [ + "handlingCutoffTime" + ] + }, + "_handlingCutoffTimezone": { + "oneof": [ + "handlingCutoffTimezone" + ] } }, "fields": { @@ -1750,6 +1806,20 @@ "options": { "proto3_optional": true } + }, + "handlingCutoffTime": { + "type": "string", + "id": 12, + "options": { + "proto3_optional": true + } + }, + "handlingCutoffTimezone": { + "type": "string", + "id": 13, + "options": { + "proto3_optional": true + } } } }, @@ -2189,6 +2259,60 @@ } } }, + "HandlingCutoffTime": { + "oneofs": { + "_country": { + "oneof": [ + "country" + ] + }, + "_cutoffTime": { + "oneof": [ + "cutoffTime" + ] + }, + "_cutoffTimezone": { + "oneof": [ + "cutoffTimezone" + ] + }, + "_disableDeliveryAfterCutoff": { + "oneof": [ + "disableDeliveryAfterCutoff" + ] + } + }, + "fields": { + "country": { + "type": "string", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "cutoffTime": { + "type": "string", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "cutoffTimezone": { + "type": "string", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "disableDeliveryAfterCutoff": { + "type": "bool", + "id": 4, + "options": { + "proto3_optional": true + } + } + } + }, "ProductsService": { "options": { "(google.api.default_host)": "merchantapi.googleapis.com", @@ -4488,7 +4612,13 @@ "LOCAL_INVENTORY_ADS": 3, "FREE_LISTINGS": 4, "FREE_LOCAL_LISTINGS": 5, - "YOUTUBE_SHOPPING": 6 + "YOUTUBE_SHOPPING": 6, + "YOUTUBE_SHOPPING_CHECKOUT": 7, + "YOUTUBE_AFFILIATE": 8, + "FREE_VEHICLE_LISTINGS": 9, + "VEHICLE_ADS": 10, + "CLOUD_RETAIL": 11, + "LOCAL_CLOUD_RETAIL": 12 } } } @@ -4513,11 +4643,16 @@ "LOCAL_INVENTORY_ADS": 5, "VEHICLE_INVENTORY_ADS": 6, "FREE_LISTINGS": 7, + "FREE_LISTINGS_UCP_CHECKOUT": 19, "FREE_LOCAL_LISTINGS": 8, "FREE_LOCAL_VEHICLE_LISTINGS": 9, + "YOUTUBE_AFFILIATE": 18, "YOUTUBE_SHOPPING": 10, "CLOUD_RETAIL": 11, - "LOCAL_CLOUD_RETAIL": 12 + "LOCAL_CLOUD_RETAIL": 12, + "PRODUCT_REVIEWS": 15, + "MERCHANT_REVIEWS": 16, + "YOUTUBE_CHECKOUT": 17 } } } diff --git a/packages/google-shopping-merchant-products/samples/generated/v1/product_inputs_service.delete_product_input.js b/packages/google-shopping-merchant-products/samples/generated/v1/product_inputs_service.delete_product_input.js index 09cf3414a27..2d95d73ad1b 100644 --- a/packages/google-shopping-merchant-products/samples/generated/v1/product_inputs_service.delete_product_input.js +++ b/packages/google-shopping-merchant-products/samples/generated/v1/product_inputs_service.delete_product_input.js @@ -29,12 +29,38 @@ function main(name, dataSource) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The name of the product input resource to delete. - * Format: `accounts/{account}/productInputs/{product}` - * where the last section `product` consists of: - * `content_language~feed_label~offer_id` - * example for product name is - * `accounts/123/productInputs/en~US~sku123`. + * Required. The name of the product input to delete. + * Format: `accounts/{account}/productInputs/{productInput}` + * The {productInput} segment is a unique identifier for the product. + * This identifier must be unique within a merchant account and generally + * follows the structure: `content_language~feed_label~offer_id`. Example: + * `en~US~sku123` For legacy local products, the structure is: + * `local~content_language~feed_label~offer_id`. Example: `local~en~US~sku123` + * The format of the {productInput} segment in the URL is automatically + * detected by the server, supporting two options: + * 1. **Encoded Format**: The `{productInput}` segment is an unpadded + * base64url + * encoded string (RFC 4648 Section 5). The decoded string must result + * in the `content_language~feed_label~offer_id` structure. This encoding + * MUST be used if any part of the product identifier (like `offer_id`) + * contains characters such as `/`, `%`, or `~`. + * * Example: To represent the product ID `en~US~sku/123`, the + * `{productInput}` segment must be the base64url encoding of this + * string, which is `ZW5-VVMtc2t1LzEyMw`. The full resource name + * for the product would be + * `accounts/123/productInputs/ZW5-VVMtc2t1LzEyMw`. + * 2. **Plain Format**: The `{productInput}` segment is the tilde-separated + * string + * `content_language~feed_label~offer_id`. This format is suitable only + * when `content_language`, `feed_label`, and `offer_id` do not contain + * URL-problematic characters like `/`, `%`, or `~`. + * We recommend using the **Encoded Format** for all product IDs to ensure + * correct parsing, especially those containing special characters. The + * presence of tilde (`~`) characters in the `{productInput}` segment is used + * to differentiate between the two formats. + * Note: For calls to the v1beta version, the plain format is + * `channel~content_language~feed_label~offer_id`, for example: + * `accounts/123/productinputs/online~en~US~sku123`. */ // const name = 'abc123' /** diff --git a/packages/google-shopping-merchant-products/samples/generated/v1/product_inputs_service.insert_product_input.js b/packages/google-shopping-merchant-products/samples/generated/v1/product_inputs_service.insert_product_input.js index 8ca1b2ff6af..c828446205e 100644 --- a/packages/google-shopping-merchant-products/samples/generated/v1/product_inputs_service.insert_product_input.js +++ b/packages/google-shopping-merchant-products/samples/generated/v1/product_inputs_service.insert_product_input.js @@ -41,8 +41,8 @@ function main(parent, productInput, dataSource) { * Required. The primary or supplemental product data source name. If the * product already exists and data source provided is different, then the * product will be moved to a new data source. For more information, see - * Overview of Data sources - * sub-API (/merchant/api/guides/data-sources/overview). + * Create a primary data + * source (/merchant/api/guides/data-sources/api-sources#create-primary-data-source). * Only API data sources are supported. * Format: `accounts/{account}/dataSources/{datasource}`. For example, * `accounts/123456/dataSources/104628`. diff --git a/packages/google-shopping-merchant-products/samples/generated/v1/product_inputs_service.update_product_input.js b/packages/google-shopping-merchant-products/samples/generated/v1/product_inputs_service.update_product_input.js index a86e7718001..1d987cfa38f 100644 --- a/packages/google-shopping-merchant-products/samples/generated/v1/product_inputs_service.update_product_input.js +++ b/packages/google-shopping-merchant-products/samples/generated/v1/product_inputs_service.update_product_input.js @@ -30,7 +30,8 @@ function main(productInput, dataSource) { */ /** * Required. The product input resource to update. Information you submit will - * be applied to the processed product as well. + * be applied to the processed product as well. The `name` field within this + * resource identifies the product input to be updated. */ // const productInput = {} /** diff --git a/packages/google-shopping-merchant-products/samples/generated/v1/products_service.get_product.js b/packages/google-shopping-merchant-products/samples/generated/v1/products_service.get_product.js index 9d04514edb3..5b2b5467c97 100644 --- a/packages/google-shopping-merchant-products/samples/generated/v1/products_service.get_product.js +++ b/packages/google-shopping-merchant-products/samples/generated/v1/products_service.get_product.js @@ -29,16 +29,36 @@ function main(name) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The name of the product to retrieve. - * Format: - * `accounts/{account}/products/{product}` where the last - * section `product` consists of: - * `content_language~feed_label~offer_id` - * example for product name is `accounts/123/products/en~US~sku123`. A legacy - * local product name would be `accounts/123/products/local~en~US~sku123`. - * Note: For calls to the v1beta version, the `product` section consists - * of: `channel~content_language~feed_label~offer_id`, for example: - * `accounts/123/products/online~en~US~sku123`. + * Required. The name of the product. + * Format: `accounts/{account}/products/{product}` + * The `{product}` segment is a unique identifier for the product. + * This identifier must be unique within a merchant account and generally + * follows the structure: `content_language~feed_label~offer_id`. Example: + * `en~US~sku123` For legacy local products, the structure is: + * `local~content_language~feed_label~offer_id`. Example: `local~en~US~sku123` + * The format of the `{product}` segment in the URL is automatically detected + * by the server, supporting two options: + * 1. **Encoded Format**: The `{product}` segment is an unpadded base64url + * encoded string (RFC 4648 Section 5). The decoded string must result + * in the `content_language~feed_label~offer_id` structure. This encoding + * MUST be used if any part of the product identifier (like `offer_id`) + * contains characters such as `/`, `%`, or `~`. + * * Example: To represent the product ID `en~US~sku/123`, the + * `{product}` segment must be the base64url encoding of this + * string, which is `ZW5-VVMtc2t1LzEyMw`. The full resource name + * for the product would be + * `accounts/123/products/ZW5-VVMtc2t1LzEyMw`. + * 2. **Plain Format**: The `{product}` segment is the tilde-separated string + * `content_language~feed_label~offer_id`. This format is suitable only + * when `content_language`, `feed_label`, and `offer_id` do not contain + * URL-problematic characters like `/`, `%`, or `~`. + * We recommend using the **Encoded Format** for all product IDs to ensure + * correct parsing, especially those containing special characters. The + * presence of tilde (`~`) characters in the `{product}` segment is used to + * differentiate between the two formats. + * Note: For calls to the v1beta version, the plain format is + * `channel~content_language~feed_label~offer_id`, for example: + * `accounts/123/products/online~en~US~sku123`. */ // const name = 'abc123' diff --git a/packages/google-shopping-merchant-products/samples/generated/v1/snippet_metadata_google.shopping.merchant.products.v1.json b/packages/google-shopping-merchant-products/samples/generated/v1/snippet_metadata_google.shopping.merchant.products.v1.json index e8f5a8a15d8..f2ce23bc0e6 100644 --- a/packages/google-shopping-merchant-products/samples/generated/v1/snippet_metadata_google.shopping.merchant.products.v1.json +++ b/packages/google-shopping-merchant-products/samples/generated/v1/snippet_metadata_google.shopping.merchant.products.v1.json @@ -15,7 +15,7 @@ "regionTag": "merchantapi_v1_generated_ProductInputsService_InsertProductInput_async", "title": "ProductInputsService insertProductInput Sample", "origin": "API_DEFINITION", - "description": " [Uploads a product input to your Merchant Center account](/merchant/api/guides/products/overview#upload-product-input). You must have a products [data source](/merchant/api/guides/data-sources/overview) to be able to insert a product. The unique identifier of the data source is passed as a query parameter in the request URL. If a product input with the same contentLanguage, offerId, and dataSource already exists, then the product input inserted by this method replaces that entry. After inserting, updating, or deleting a product input, it may take several minutes before the processed product can be retrieved.", + "description": " [Uploads a product input to your Merchant Center account](/merchant/api/guides/products/add-manage#add_a_product). You must have a products [data source](/merchant/api/guides/data-sources/api-sources#create-primary-data-source) to be able to insert a product. The unique identifier of the data source is passed as a query parameter in the request URL. If a product input with the same contentLanguage, offerId, and dataSource already exists, then the product input inserted by this method replaces that entry. After inserting, updating, or deleting a product input, it may take several minutes before the processed product can be retrieved.", "canonical": true, "file": "product_inputs_service.insert_product_input.js", "language": "JAVASCRIPT", @@ -63,14 +63,14 @@ "regionTag": "merchantapi_v1_generated_ProductInputsService_UpdateProductInput_async", "title": "ProductInputsService updateProductInput Sample", "origin": "API_DEFINITION", - "description": " Updates the existing product input in your Merchant Center account. After inserting, updating, or deleting a product input, it may take several minutes before the processed product can be retrieved.", + "description": " Updates the existing product input in your Merchant Center account. The name of the product input to update is taken from the `name` field within the `ProductInput` resource. After inserting, updating, or deleting a product input, it may take several minutes before the processed product can be retrieved.", "canonical": true, "file": "product_inputs_service.update_product_input.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 76, + "end": 77, "type": "FULL" } ], @@ -118,7 +118,7 @@ "segments": [ { "start": 25, - "end": 66, + "end": 92, "type": "FULL" } ], @@ -162,7 +162,7 @@ "segments": [ { "start": 25, - "end": 62, + "end": 82, "type": "FULL" } ], diff --git a/packages/google-shopping-merchant-products/src/v1/product_inputs_service_client.ts b/packages/google-shopping-merchant-products/src/v1/product_inputs_service_client.ts index 558a4983bbf..a1aa89fedf7 100644 --- a/packages/google-shopping-merchant-products/src/v1/product_inputs_service_client.ts +++ b/packages/google-shopping-merchant-products/src/v1/product_inputs_service_client.ts @@ -335,11 +335,11 @@ export class ProductInputsServiceClient { // ------------------- /** * [Uploads a product input to your Merchant Center - * account](/merchant/api/guides/products/overview#upload-product-input). You + * account](/merchant/api/guides/products/add-manage#add_a_product). You * must have a products [data - * source](/merchant/api/guides/data-sources/overview) to be able to insert a - * product. The unique identifier of the data source is passed as a query - * parameter in the request URL. + * source](/merchant/api/guides/data-sources/api-sources#create-primary-data-source) + * to be able to insert a product. The unique identifier of the data source is + * passed as a query parameter in the request URL. * * If a product input with the same contentLanguage, offerId, and dataSource * already exists, then the product input inserted by this method replaces @@ -359,8 +359,8 @@ export class ProductInputsServiceClient { * Required. The primary or supplemental product data source name. If the * product already exists and data source provided is different, then the * product will be moved to a new data source. For more information, see - * [Overview of Data sources - * sub-API](/merchant/api/guides/data-sources/overview). + * [Create a primary data + * source](/merchant/api/guides/data-sources/api-sources#create-primary-data-source). * * Only API data sources are supported. * @@ -455,6 +455,8 @@ export class ProductInputsServiceClient { } /** * Updates the existing product input in your Merchant Center account. + * The name of the product input to update is taken from the `name` field + * within the `ProductInput` resource. * * After inserting, updating, or deleting a product input, it may take several * minutes before the processed product can be retrieved. @@ -463,7 +465,8 @@ export class ProductInputsServiceClient { * The request object that will be sent. * @param {google.shopping.merchant.products.v1.ProductInput} request.productInput * Required. The product input resource to update. Information you submit will - * be applied to the processed product as well. + * be applied to the processed product as well. The `name` field within this + * resource identifies the product input to be updated. * @param {google.protobuf.FieldMask} [request.updateMask] * Optional. The list of product attributes to be updated. * @@ -584,12 +587,44 @@ export class ProductInputsServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Required. The name of the product input resource to delete. - * Format: `accounts/{account}/productInputs/{product}` - * where the last section `product` consists of: - * `content_language~feed_label~offer_id` - * example for product name is - * `accounts/123/productInputs/en~US~sku123`. + * Required. The name of the product input to delete. + * Format: `accounts/{account}/productInputs/{productInput}` + * + * The {productInput} segment is a unique identifier for the product. + * This identifier must be unique within a merchant account and generally + * follows the structure: `content_language~feed_label~offer_id`. Example: + * `en~US~sku123` For legacy local products, the structure is: + * `local~content_language~feed_label~offer_id`. Example: `local~en~US~sku123` + * + * The format of the {productInput} segment in the URL is automatically + * detected by the server, supporting two options: + * + * 1. **Encoded Format**: The `{productInput}` segment is an unpadded + * base64url + * encoded string (RFC 4648 Section 5). The decoded string must result + * in the `content_language~feed_label~offer_id` structure. This encoding + * MUST be used if any part of the product identifier (like `offer_id`) + * contains characters such as `/`, `%`, or `~`. + * * Example: To represent the product ID `en~US~sku/123`, the + * `{productInput}` segment must be the base64url encoding of this + * string, which is `ZW5-VVMtc2t1LzEyMw`. The full resource name + * for the product would be + * `accounts/123/productInputs/ZW5-VVMtc2t1LzEyMw`. + * + * 2. **Plain Format**: The `{productInput}` segment is the tilde-separated + * string + * `content_language~feed_label~offer_id`. This format is suitable only + * when `content_language`, `feed_label`, and `offer_id` do not contain + * URL-problematic characters like `/`, `%`, or `~`. + * + * We recommend using the **Encoded Format** for all product IDs to ensure + * correct parsing, especially those containing special characters. The + * presence of tilde (`~`) characters in the `{productInput}` segment is used + * to differentiate between the two formats. + * + * Note: For calls to the v1beta version, the plain format is + * `channel~content_language~feed_label~offer_id`, for example: + * `accounts/123/productinputs/online~en~US~sku123`. * @param {string} request.dataSource * Required. The primary or supplemental data source from which the product * input should be deleted. Format: diff --git a/packages/google-shopping-merchant-products/src/v1/products_service_client.ts b/packages/google-shopping-merchant-products/src/v1/products_service_client.ts index be0b9e91680..0e3c778d118 100644 --- a/packages/google-shopping-merchant-products/src/v1/products_service_client.ts +++ b/packages/google-shopping-merchant-products/src/v1/products_service_client.ts @@ -351,16 +351,42 @@ export class ProductsServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Required. The name of the product to retrieve. - * Format: - * `accounts/{account}/products/{product}` where the last - * section `product` consists of: - * `content_language~feed_label~offer_id` - * example for product name is `accounts/123/products/en~US~sku123`. A legacy - * local product name would be `accounts/123/products/local~en~US~sku123`. - * Note: For calls to the v1beta version, the `product` section consists - * of: `channel~content_language~feed_label~offer_id`, for example: - * `accounts/123/products/online~en~US~sku123`. + * Required. The name of the product. + * Format: `accounts/{account}/products/{product}` + * + * The `{product}` segment is a unique identifier for the product. + * This identifier must be unique within a merchant account and generally + * follows the structure: `content_language~feed_label~offer_id`. Example: + * `en~US~sku123` For legacy local products, the structure is: + * `local~content_language~feed_label~offer_id`. Example: `local~en~US~sku123` + * + * The format of the `{product}` segment in the URL is automatically detected + * by the server, supporting two options: + * + * 1. **Encoded Format**: The `{product}` segment is an unpadded base64url + * encoded string (RFC 4648 Section 5). The decoded string must result + * in the `content_language~feed_label~offer_id` structure. This encoding + * MUST be used if any part of the product identifier (like `offer_id`) + * contains characters such as `/`, `%`, or `~`. + * * Example: To represent the product ID `en~US~sku/123`, the + * `{product}` segment must be the base64url encoding of this + * string, which is `ZW5-VVMtc2t1LzEyMw`. The full resource name + * for the product would be + * `accounts/123/products/ZW5-VVMtc2t1LzEyMw`. + * + * 2. **Plain Format**: The `{product}` segment is the tilde-separated string + * `content_language~feed_label~offer_id`. This format is suitable only + * when `content_language`, `feed_label`, and `offer_id` do not contain + * URL-problematic characters like `/`, `%`, or `~`. + * + * We recommend using the **Encoded Format** for all product IDs to ensure + * correct parsing, especially those containing special characters. The + * presence of tilde (`~`) characters in the `{product}` segment is used to + * differentiate between the two formats. + * + * Note: For calls to the v1beta version, the plain format is + * `channel~content_language~feed_label~offer_id`, for example: + * `accounts/123/products/online~en~US~sku123`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array.