Skip to content

Commit aad74f0

Browse files
1 parent fd6c064 commit aad74f0

11 files changed

Lines changed: 689 additions & 7 deletions

src/Firestore.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,16 @@ public function __construct($clientOrConfig = [], $rootUrl = null)
466466
'type' => 'string',
467467
],
468468
],
469+
],'executePipeline' => [
470+
'path' => 'v1/{+database}/documents:executePipeline',
471+
'httpMethod' => 'POST',
472+
'parameters' => [
473+
'database' => [
474+
'location' => 'path',
475+
'type' => 'string',
476+
'required' => true,
477+
],
478+
],
469479
],'get' => [
470480
'path' => 'v1/{+name}',
471481
'httpMethod' => 'GET',
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
<?php
2+
/*
3+
* Copyright 2014 Google Inc.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
6+
* use this file except in compliance with the License. You may obtain a copy of
7+
* the License at
8+
*
9+
* http://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, WITHOUT
13+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
* License for the specific language governing permissions and limitations under
15+
* the License.
16+
*/
17+
18+
namespace Google\Service\Firestore;
19+
20+
class ExecutePipelineRequest extends \Google\Model
21+
{
22+
protected $newTransactionType = TransactionOptions::class;
23+
protected $newTransactionDataType = '';
24+
/**
25+
* Execute the pipeline in a snapshot transaction at the given time. This must
26+
* be a microsecond precision timestamp within the past one hour, or if Point-
27+
* in-Time Recovery is enabled, can additionally be a whole minute timestamp
28+
* within the past 7 days.
29+
*
30+
* @var string
31+
*/
32+
public $readTime;
33+
protected $structuredPipelineType = StructuredPipeline::class;
34+
protected $structuredPipelineDataType = '';
35+
/**
36+
* Run the query within an already active transaction. The value here is the
37+
* opaque transaction ID to execute the query in.
38+
*
39+
* @var string
40+
*/
41+
public $transaction;
42+
43+
/**
44+
* Execute the pipeline in a new transaction. The identifier of the newly
45+
* created transaction will be returned in the first response on the stream.
46+
* This defaults to a read-only transaction.
47+
*
48+
* @param TransactionOptions $newTransaction
49+
*/
50+
public function setNewTransaction(TransactionOptions $newTransaction)
51+
{
52+
$this->newTransaction = $newTransaction;
53+
}
54+
/**
55+
* @return TransactionOptions
56+
*/
57+
public function getNewTransaction()
58+
{
59+
return $this->newTransaction;
60+
}
61+
/**
62+
* Execute the pipeline in a snapshot transaction at the given time. This must
63+
* be a microsecond precision timestamp within the past one hour, or if Point-
64+
* in-Time Recovery is enabled, can additionally be a whole minute timestamp
65+
* within the past 7 days.
66+
*
67+
* @param string $readTime
68+
*/
69+
public function setReadTime($readTime)
70+
{
71+
$this->readTime = $readTime;
72+
}
73+
/**
74+
* @return string
75+
*/
76+
public function getReadTime()
77+
{
78+
return $this->readTime;
79+
}
80+
/**
81+
* A pipelined operation.
82+
*
83+
* @param StructuredPipeline $structuredPipeline
84+
*/
85+
public function setStructuredPipeline(StructuredPipeline $structuredPipeline)
86+
{
87+
$this->structuredPipeline = $structuredPipeline;
88+
}
89+
/**
90+
* @return StructuredPipeline
91+
*/
92+
public function getStructuredPipeline()
93+
{
94+
return $this->structuredPipeline;
95+
}
96+
/**
97+
* Run the query within an already active transaction. The value here is the
98+
* opaque transaction ID to execute the query in.
99+
*
100+
* @param string $transaction
101+
*/
102+
public function setTransaction($transaction)
103+
{
104+
$this->transaction = $transaction;
105+
}
106+
/**
107+
* @return string
108+
*/
109+
public function getTransaction()
110+
{
111+
return $this->transaction;
112+
}
113+
}
114+
115+
// Adding a class alias for backwards compatibility with the previous class name.
116+
class_alias(ExecutePipelineRequest::class, 'Google_Service_Firestore_ExecutePipelineRequest');
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
<?php
2+
/*
3+
* Copyright 2014 Google Inc.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
6+
* use this file except in compliance with the License. You may obtain a copy of
7+
* the License at
8+
*
9+
* http://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, WITHOUT
13+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
* License for the specific language governing permissions and limitations under
15+
* the License.
16+
*/
17+
18+
namespace Google\Service\Firestore;
19+
20+
class ExecutePipelineResponse extends \Google\Collection
21+
{
22+
protected $collection_key = 'results';
23+
/**
24+
* The time at which the results are valid. This is a (not strictly)
25+
* monotonically increasing value across multiple responses in the same
26+
* stream. The API guarantees that all previously returned results are still
27+
* valid at the latest `execution_time`. This allows the API consumer to treat
28+
* the query if it ran at the latest `execution_time` returned. If the query
29+
* returns no results, a response with `execution_time` and no `results` will
30+
* be sent, and this represents the time at which the operation was run.
31+
*
32+
* @var string
33+
*/
34+
public $executionTime;
35+
protected $explainStatsType = ExplainStats::class;
36+
protected $explainStatsDataType = '';
37+
protected $resultsType = Document::class;
38+
protected $resultsDataType = 'array';
39+
/**
40+
* Newly created transaction identifier. This field is only specified as part
41+
* of the first response from the server, alongside the `results` field when
42+
* the original request specified ExecuteRequest.new_transaction.
43+
*
44+
* @var string
45+
*/
46+
public $transaction;
47+
48+
/**
49+
* The time at which the results are valid. This is a (not strictly)
50+
* monotonically increasing value across multiple responses in the same
51+
* stream. The API guarantees that all previously returned results are still
52+
* valid at the latest `execution_time`. This allows the API consumer to treat
53+
* the query if it ran at the latest `execution_time` returned. If the query
54+
* returns no results, a response with `execution_time` and no `results` will
55+
* be sent, and this represents the time at which the operation was run.
56+
*
57+
* @param string $executionTime
58+
*/
59+
public function setExecutionTime($executionTime)
60+
{
61+
$this->executionTime = $executionTime;
62+
}
63+
/**
64+
* @return string
65+
*/
66+
public function getExecutionTime()
67+
{
68+
return $this->executionTime;
69+
}
70+
/**
71+
* Query explain stats. This is present on the **last** response if the
72+
* request configured explain to run in 'analyze' or 'explain' mode in the
73+
* pipeline options. If the query does not return any results, a response with
74+
* `explain_stats` and no `results` will still be sent.
75+
*
76+
* @param ExplainStats $explainStats
77+
*/
78+
public function setExplainStats(ExplainStats $explainStats)
79+
{
80+
$this->explainStats = $explainStats;
81+
}
82+
/**
83+
* @return ExplainStats
84+
*/
85+
public function getExplainStats()
86+
{
87+
return $this->explainStats;
88+
}
89+
/**
90+
* An ordered batch of results returned executing a pipeline. The batch size
91+
* is variable, and can even be zero for when only a partial progress message
92+
* is returned. The fields present in the returned documents are only those
93+
* that were explicitly requested in the pipeline, this includes those like
94+
* `__name__` and `__update_time__`. This is explicitly a divergence from
95+
* `Firestore.RunQuery` / `Firestore.GetDocument` RPCs which always return
96+
* such fields even when they are not specified in the `mask`.
97+
*
98+
* @param Document[] $results
99+
*/
100+
public function setResults($results)
101+
{
102+
$this->results = $results;
103+
}
104+
/**
105+
* @return Document[]
106+
*/
107+
public function getResults()
108+
{
109+
return $this->results;
110+
}
111+
/**
112+
* Newly created transaction identifier. This field is only specified as part
113+
* of the first response from the server, alongside the `results` field when
114+
* the original request specified ExecuteRequest.new_transaction.
115+
*
116+
* @param string $transaction
117+
*/
118+
public function setTransaction($transaction)
119+
{
120+
$this->transaction = $transaction;
121+
}
122+
/**
123+
* @return string
124+
*/
125+
public function getTransaction()
126+
{
127+
return $this->transaction;
128+
}
129+
}
130+
131+
// Adding a class alias for backwards compatibility with the previous class name.
132+
class_alias(ExecutePipelineResponse::class, 'Google_Service_Firestore_ExecutePipelineResponse');

src/Firestore/ExplainStats.php

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?php
2+
/*
3+
* Copyright 2014 Google Inc.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
6+
* use this file except in compliance with the License. You may obtain a copy of
7+
* the License at
8+
*
9+
* http://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, WITHOUT
13+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
* License for the specific language governing permissions and limitations under
15+
* the License.
16+
*/
17+
18+
namespace Google\Service\Firestore;
19+
20+
class ExplainStats extends \Google\Model
21+
{
22+
/**
23+
* The format depends on the `output_format` options in the request. Currently
24+
* there are two supported options: `TEXT` and `JSON`. Both supply a
25+
* `google.protobuf.StringValue`.
26+
*
27+
* @var array[]
28+
*/
29+
public $data;
30+
31+
/**
32+
* The format depends on the `output_format` options in the request. Currently
33+
* there are two supported options: `TEXT` and `JSON`. Both supply a
34+
* `google.protobuf.StringValue`.
35+
*
36+
* @param array[] $data
37+
*/
38+
public function setData($data)
39+
{
40+
$this->data = $data;
41+
}
42+
/**
43+
* @return array[]
44+
*/
45+
public function getData()
46+
{
47+
return $this->data;
48+
}
49+
}
50+
51+
// Adding a class alias for backwards compatibility with the previous class name.
52+
class_alias(ExplainStats::class, 'Google_Service_Firestore_ExplainStats');

0 commit comments

Comments
 (0)