-
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: Add FileUploads service (#7702)
docs: A comment for enum value `PRODUCTS` in enum `Channel` is changed PiperOrigin-RevId: 678641097 Source-Link: googleapis/googleapis@9c4c174 Source-Link: googleapis/googleapis-gen@13cfe50 Copy-Tag: eyJwIjoiU2hvcHBpbmdNZXJjaGFudERhdGFzb3VyY2VzLy5Pd2xCb3QueWFtbCIsImgiOiIxM2NmZTUwNGE2ZjBhZWRjMDQxNmMyMzg1MWYyNzgxNTc4MzRmOTA1In0= * fix directory casing from new PHP namespace Co-authored-by: Brent Shaffer <[email protected]>
- Loading branch information
1 parent
abe3c50
commit 51c6ec1
Showing
61 changed files
with
1,950 additions
and
130 deletions.
There are no files selected for viewing
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
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,4 @@ | ||
deep-copy-regex: | ||
- source: /google/shopping/merchant/datasources/(v1beta)/.*-php/(.*) | ||
dest: /owl-bot-staging/ShoppingMerchantDataSources/$1/$2 | ||
api-name: ShoppingMerchantDataSources |
File renamed without changes.
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 |
---|---|---|
|
@@ -14,7 +14,7 @@ $ git clone [email protected]:googleapis/google-cloud-php.git | |
``` | ||
|
||
* Move your changes into the correct location in that library. Library code | ||
belongs in `ShoppingMerchantDatasources/src`, and tests in `ShoppingMerchantDatasources/tests`. | ||
belongs in `ShoppingMerchantDataSources/src`, and tests in `ShoppingMerchantDataSources/tests`. | ||
|
||
* Push the changes in a new branch to a fork, and open a new pull request | ||
[here](https://github.com/googleapis/google-cloud-php). | ||
|
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
ShoppingMerchantDatasources/README.md → ShoppingMerchantDataSources/README.md
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
File renamed without changes.
6 changes: 3 additions & 3 deletions
6
ShoppingMerchantDatasources/composer.json → ShoppingMerchantDataSources/composer.json
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
Binary file renamed
BIN
+5 KB
...tasources/metadata/V1Beta/Datasources.php → ...taSources/metadata/V1Beta/Datasources.php
Binary file not shown.
Binary file renamed
BIN
+1.67 KB
...urces/metadata/V1Beta/Datasourcetypes.php → ...urces/metadata/V1Beta/Datasourcetypes.php
Binary file not shown.
Binary file renamed
BIN
+1.85 KB
...atasources/metadata/V1Beta/Fileinputs.php → ...ataSources/metadata/V1Beta/Fileinputs.php
Binary file not shown.
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
File renamed without changes.
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
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
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
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
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
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
78 changes: 78 additions & 0 deletions
78
ShoppingMerchantDataSources/samples/V1beta/FileUploadsServiceClient/get_file_upload.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,78 @@ | ||
<?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 merchantapi_v1beta_generated_FileUploadsService_GetFileUpload_sync] | ||
use Google\ApiCore\ApiException; | ||
use Google\Shopping\Merchant\DataSources\V1beta\Client\FileUploadsServiceClient; | ||
use Google\Shopping\Merchant\DataSources\V1beta\FileUpload; | ||
use Google\Shopping\Merchant\DataSources\V1beta\GetFileUploadRequest; | ||
|
||
/** | ||
* Gets the latest data source file upload. Only the `latest` alias is | ||
* accepted for a file upload. | ||
* | ||
* @param string $formattedName The name of the data source file upload to retrieve. | ||
* Format: | ||
* `accounts/{account}/dataSources/{datasource}/fileUploads/latest` | ||
* Please see {@see FileUploadsServiceClient::fileUploadName()} for help formatting this field. | ||
*/ | ||
function get_file_upload_sample(string $formattedName): void | ||
{ | ||
// Create a client. | ||
$fileUploadsServiceClient = new FileUploadsServiceClient(); | ||
|
||
// Prepare the request message. | ||
$request = (new GetFileUploadRequest()) | ||
->setName($formattedName); | ||
|
||
// Call the API and handle any network failures. | ||
try { | ||
/** @var FileUpload $response */ | ||
$response = $fileUploadsServiceClient->getFileUpload($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 | ||
{ | ||
$formattedName = FileUploadsServiceClient::fileUploadName( | ||
'[ACCOUNT]', | ||
'[DATASOURCE]', | ||
'[FILEUPLOAD]' | ||
); | ||
|
||
get_file_upload_sample($formattedName); | ||
} | ||
// [END merchantapi_v1beta_generated_FileUploadsService_GetFileUpload_sync] |
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
Oops, something went wrong.