Skip to content

Commit 1063e3c

Browse files
feat: [Firestore] publish the pipelines API to the stable branch (#8781)
* feat: publish the pipelines API to the stable branch PiperOrigin-RevId: 840829013 Source-Link: googleapis/googleapis@534adc5 Source-Link: googleapis/googleapis-gen@38e4d8b Copy-Tag: eyJwIjoiRmlyZXN0b3JlLy5Pd2xCb3QueWFtbCIsImgiOiIzOGU0ZDhiZjU3NzQ0NDJkZDc3ODkzNTE1NGY1YWU1NjUzN2Y1NGUyIn0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent b550805 commit 1063e3c

21 files changed

Lines changed: 1674 additions & 0 deletions

Firestore/metadata/V1/Document.php

663 Bytes
Binary file not shown.

Firestore/metadata/V1/ExplainStats.php

Lines changed: 30 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
1010 Bytes
Binary file not shown.

Firestore/metadata/V1/Pipeline.php

Lines changed: 35 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<?php
2+
/*
3+
* Copyright 2025 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
/*
19+
* GENERATED CODE WARNING
20+
* This file was automatically generated - do not edit!
21+
*/
22+
23+
require_once __DIR__ . '/../../../vendor/autoload.php';
24+
25+
// [START firestore_v1_generated_Firestore_ExecutePipeline_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\ApiCore\ServerStream;
28+
use Google\Cloud\Firestore\V1\Client\FirestoreClient;
29+
use Google\Cloud\Firestore\V1\ExecutePipelineRequest;
30+
use Google\Cloud\Firestore\V1\ExecutePipelineResponse;
31+
32+
/**
33+
* Executes a pipeline query.
34+
*
35+
* @param string $database Database identifier, in the form
36+
* `projects/{project}/databases/{database}`.
37+
*/
38+
function execute_pipeline_sample(string $database): void
39+
{
40+
// Create a client.
41+
$firestoreClient = new FirestoreClient();
42+
43+
// Prepare the request message.
44+
$request = (new ExecutePipelineRequest())
45+
->setDatabase($database);
46+
47+
// Call the API and handle any network failures.
48+
try {
49+
/** @var ServerStream $stream */
50+
$stream = $firestoreClient->executePipeline($request);
51+
52+
/** @var ExecutePipelineResponse $element */
53+
foreach ($stream->readAll() as $element) {
54+
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
55+
}
56+
} catch (ApiException $ex) {
57+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
58+
}
59+
}
60+
61+
/**
62+
* Helper to execute the sample.
63+
*
64+
* This sample has been automatically generated and should be regarded as a code
65+
* template only. It will require modifications to work:
66+
* - It may require correct/in-range values for request initialization.
67+
* - It may require specifying regional endpoints when creating the service client,
68+
* please see the apiEndpoint client configuration option for more details.
69+
*/
70+
function callSample(): void
71+
{
72+
$database = '[DATABASE]';
73+
74+
execute_pipeline_sample($database);
75+
}
76+
// [END firestore_v1_generated_Firestore_ExecutePipeline_sync]

Firestore/src/V1/Client/FirestoreClient.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@
4646
use Google\Cloud\Firestore\V1\CreateDocumentRequest;
4747
use Google\Cloud\Firestore\V1\DeleteDocumentRequest;
4848
use Google\Cloud\Firestore\V1\Document;
49+
use Google\Cloud\Firestore\V1\ExecutePipelineRequest;
50+
use Google\Cloud\Firestore\V1\ExecutePipelineResponse;
4951
use Google\Cloud\Firestore\V1\GetDocumentRequest;
5052
use Google\Cloud\Firestore\V1\ListCollectionIdsRequest;
5153
use Google\Cloud\Firestore\V1\ListDocumentsRequest;
@@ -380,6 +382,28 @@ public function deleteDocument(DeleteDocumentRequest $request, array $callOption
380382
$this->startApiCall('DeleteDocument', $request, $callOptions)->wait();
381383
}
382384

385+
/**
386+
* Executes a pipeline query.
387+
*
388+
* @example samples/V1/FirestoreClient/execute_pipeline.php
389+
*
390+
* @param ExecutePipelineRequest $request A request to house fields associated with the call.
391+
* @param array $callOptions {
392+
* Optional.
393+
*
394+
* @type int $timeoutMillis
395+
* Timeout to use for this call.
396+
* }
397+
*
398+
* @return ServerStream<ExecutePipelineResponse>
399+
*
400+
* @throws ApiException Thrown if the API call fails.
401+
*/
402+
public function executePipeline(ExecutePipelineRequest $request, array $callOptions = []): ServerStream
403+
{
404+
return $this->startApiCall('ExecutePipeline', $request, $callOptions);
405+
}
406+
383407
/**
384408
* Gets a single document.
385409
*

0 commit comments

Comments
 (0)