|
| 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'); |
0 commit comments