-
Notifications
You must be signed in to change notification settings - Fork 438
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: UpdateCssProduct is added to CssProductInput proto (#7961)
docs: Mark `freshness_time` as deprecated docs : Mark `feed_id` as deprecated docs: A comment for field `page_size` in message `.google.shopping.css.v1.ListChildAccountsRequest` is changed docs: A comment for field `low_price` in message `.google.shopping.css.v1.Attributes` is changed docs: A comment for field `high_price` in message `.google.shopping.css.v1.Attributes` is changed docs: A comment for field `number_of_offers` in message `.google.shopping.css.v1.Attributes` is changed docs: A comment for field `headline_offer_price` in message `.google.shopping.css.v1.Attributes` is changed docs: A comment for field `headline_offer_shipping_price` in message `.google.shopping.css.v1.Attributes` is changed docs: A comment for field `approved_countries` in message `.google.shopping.css.v1.CssProductStatus` is changed docs: A comment for field `pending_countries` in message `.google.shopping.css.v1.CssProductStatus` is changed docs: A comment for field `disapproved_countries` in message `.google.shopping.css.v1.CssProductStatus` is changed docs: A comment for field `servability` in message `.google.shopping.css.v1.CssProductStatus` is changed docs: A comment for field `applicable_countries` in message `.google.shopping.css.v1.CssProductStatus` is changed docs: A comment for field `feed_id` in message`.google.shopping.css.v1.InsertCssProductInputRequest` is changed docs: A comment for message `CssProduct` is changed PiperOrigin-RevId: 708397816 Source-Link: googleapis/googleapis@892e72f Source-Link: googleapis/googleapis-gen@09992f0 Copy-Tag: eyJwIjoiU2hvcHBpbmdDc3MvLk93bEJvdC55YW1sIiwiaCI6IjA5OTkyZjBkOTQ1YmViMDkyMTIyZmExYmRmNDUzZjUzMjFiYzBmOGMifQ==
- Loading branch information
1 parent
f21a8f4
commit 305c0e8
Showing
17 changed files
with
553 additions
and
95 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 98 additions & 0 deletions
98
ShoppingCss/samples/V1/CssProductInputsServiceClient/update_css_product_input.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
<?php | ||
/* | ||
* Copyright 2024 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/* | ||
* GENERATED CODE WARNING | ||
* This file was automatically generated - do not edit! | ||
*/ | ||
|
||
require_once __DIR__ . '/../../../vendor/autoload.php'; | ||
|
||
// [START css_v1_generated_CssProductInputsService_UpdateCssProductInput_sync] | ||
use Google\ApiCore\ApiException; | ||
use Google\Shopping\Css\V1\Client\CssProductInputsServiceClient; | ||
use Google\Shopping\Css\V1\CssProductInput; | ||
use Google\Shopping\Css\V1\UpdateCssProductInputRequest; | ||
|
||
/** | ||
* Updates the existing Css Product input in your CSS Center account. | ||
* | ||
* After inserting, updating, or deleting a CSS Product input, it may take | ||
* several minutes before the processed Css Product can be retrieved. | ||
* | ||
* @param string $cssProductInputRawProvidedId Your unique identifier for the CSS Product. This is the same for | ||
* the CSS Product input and processed CSS Product. We only allow ids with | ||
* alphanumerics, underscores and dashes. See the [products feed | ||
* specification](https://support.google.com/merchants/answer/188494#id) for | ||
* details. | ||
* @param string $cssProductInputContentLanguage The two-letter [ISO | ||
* 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the CSS | ||
* Product. | ||
* @param string $cssProductInputFeedLabel The [feed | ||
* label](https://developers.google.com/shopping-content/guides/products/feed-labels) | ||
* for the CSS Product. | ||
* Feed Label is synonymous to "target country" and hence should always be a | ||
* valid region code. For example: 'DE' for Germany, 'FR' for France. | ||
*/ | ||
function update_css_product_input_sample( | ||
string $cssProductInputRawProvidedId, | ||
string $cssProductInputContentLanguage, | ||
string $cssProductInputFeedLabel | ||
): void { | ||
// Create a client. | ||
$cssProductInputsServiceClient = new CssProductInputsServiceClient(); | ||
|
||
// Prepare the request message. | ||
$cssProductInput = (new CssProductInput()) | ||
->setRawProvidedId($cssProductInputRawProvidedId) | ||
->setContentLanguage($cssProductInputContentLanguage) | ||
->setFeedLabel($cssProductInputFeedLabel); | ||
$request = (new UpdateCssProductInputRequest()) | ||
->setCssProductInput($cssProductInput); | ||
|
||
// Call the API and handle any network failures. | ||
try { | ||
/** @var CssProductInput $response */ | ||
$response = $cssProductInputsServiceClient->updateCssProductInput($request); | ||
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); | ||
} catch (ApiException $ex) { | ||
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); | ||
} | ||
} | ||
|
||
/** | ||
* Helper to execute the sample. | ||
* | ||
* This sample has been automatically generated and should be regarded as a code | ||
* template only. It will require modifications to work: | ||
* - It may require correct/in-range values for request initialization. | ||
* - It may require specifying regional endpoints when creating the service client, | ||
* please see the apiEndpoint client configuration option for more details. | ||
*/ | ||
function callSample(): void | ||
{ | ||
$cssProductInputRawProvidedId = '[RAW_PROVIDED_ID]'; | ||
$cssProductInputContentLanguage = '[CONTENT_LANGUAGE]'; | ||
$cssProductInputFeedLabel = '[FEED_LABEL]'; | ||
|
||
update_css_product_input_sample( | ||
$cssProductInputRawProvidedId, | ||
$cssProductInputContentLanguage, | ||
$cssProductInputFeedLabel | ||
); | ||
} | ||
// [END css_v1_generated_CssProductInputsService_UpdateCssProductInput_sync] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.